Commit 99a4cca2 authored by LABBE Corentin's avatar LABBE Corentin Committed by David S. Miller

net-next: stmmac: Convert new_state to bool

This patch convert new_state from int to bool since it store only 1 or 0
Signed-off-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 26d732ba
...@@ -775,7 +775,7 @@ static void stmmac_adjust_link(struct net_device *dev) ...@@ -775,7 +775,7 @@ static void stmmac_adjust_link(struct net_device *dev)
struct stmmac_priv *priv = netdev_priv(dev); struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phydev = dev->phydev; struct phy_device *phydev = dev->phydev;
unsigned long flags; unsigned long flags;
int new_state = 0; bool new_state = false;
if (!phydev) if (!phydev)
return; return;
...@@ -788,7 +788,7 @@ static void stmmac_adjust_link(struct net_device *dev) ...@@ -788,7 +788,7 @@ static void stmmac_adjust_link(struct net_device *dev)
/* Now we make sure that we can be in full duplex mode. /* Now we make sure that we can be in full duplex mode.
* If not, we operate in half-duplex mode. */ * If not, we operate in half-duplex mode. */
if (phydev->duplex != priv->oldduplex) { if (phydev->duplex != priv->oldduplex) {
new_state = 1; new_state = true;
if (!(phydev->duplex)) if (!(phydev->duplex))
ctrl &= ~priv->hw->link.duplex; ctrl &= ~priv->hw->link.duplex;
else else
...@@ -800,7 +800,7 @@ static void stmmac_adjust_link(struct net_device *dev) ...@@ -800,7 +800,7 @@ static void stmmac_adjust_link(struct net_device *dev)
stmmac_mac_flow_ctrl(priv, phydev->duplex); stmmac_mac_flow_ctrl(priv, phydev->duplex);
if (phydev->speed != priv->speed) { if (phydev->speed != priv->speed) {
new_state = 1; new_state = true;
switch (phydev->speed) { switch (phydev->speed) {
case 1000: case 1000:
if (priv->plat->has_gmac || if (priv->plat->has_gmac ||
...@@ -839,11 +839,11 @@ static void stmmac_adjust_link(struct net_device *dev) ...@@ -839,11 +839,11 @@ static void stmmac_adjust_link(struct net_device *dev)
writel(ctrl, priv->ioaddr + MAC_CTRL_REG); writel(ctrl, priv->ioaddr + MAC_CTRL_REG);
if (!priv->oldlink) { if (!priv->oldlink) {
new_state = 1; new_state = true;
priv->oldlink = 1; priv->oldlink = 1;
} }
} else if (priv->oldlink) { } else if (priv->oldlink) {
new_state = 1; new_state = true;
priv->oldlink = 0; priv->oldlink = 0;
priv->speed = SPEED_UNKNOWN; priv->speed = SPEED_UNKNOWN;
priv->oldduplex = DUPLEX_UNKNOWN; priv->oldduplex = DUPLEX_UNKNOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment