summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2017-05-24 09:16:43 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-25 13:08:34 -0400
commit99a4cca216d98d48e5bc848b9e88131efa364fb6 (patch)
tree3132113841d9d5b9f670d1c006db7e3dde80c05b /drivers/net/ethernet/stmicro/stmmac
parent26d732baa09daa196b426b6cb354783eb1c75ec5 (diff)
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: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 27c12e732a8a..b944eabaa1ec 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -775,7 +775,7 @@ static void stmmac_adjust_link(struct net_device *dev)
struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phydev = dev->phydev;
unsigned long flags;
- int new_state = 0;
+ bool new_state = false;
if (!phydev)
return;
@@ -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.
* If not, we operate in half-duplex mode. */
if (phydev->duplex != priv->oldduplex) {
- new_state = 1;
+ new_state = true;
if (!(phydev->duplex))
ctrl &= ~priv->hw->link.duplex;
else
@@ -800,7 +800,7 @@ static void stmmac_adjust_link(struct net_device *dev)
stmmac_mac_flow_ctrl(priv, phydev->duplex);
if (phydev->speed != priv->speed) {
- new_state = 1;
+ new_state = true;
switch (phydev->speed) {
case 1000:
if (priv->plat->has_gmac ||
@@ -839,11 +839,11 @@ static void stmmac_adjust_link(struct net_device *dev)
writel(ctrl, priv->ioaddr + MAC_CTRL_REG);
if (!priv->oldlink) {
- new_state = 1;
+ new_state = true;
priv->oldlink = 1;
}
} else if (priv->oldlink) {
- new_state = 1;
+ new_state = true;
priv->oldlink = 0;
priv->speed = SPEED_UNKNOWN;
priv->oldduplex = DUPLEX_UNKNOWN;