net-next: stmmac: Convert old_link to bool
authorLABBE Corentin <clabbe.montjoie@gmail.com>
Wed, 24 May 2017 07:16:46 +0000 (09:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 May 2017 17:08:35 +0000 (13:08 -0400)
This patch convert old_link 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>
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 33efe7038cabf7740c359b6633bc963032f02165..a916e13624ebe06e12903f2e5d6f92bc4dbda861 100644 (file)
@@ -104,7 +104,7 @@ struct stmmac_priv {
        /* TX Queue */
        struct stmmac_tx_queue tx_queue[MTL_MAX_TX_QUEUES];
 
-       int oldlink;
+       bool oldlink;
        int speed;
        int oldduplex;
        unsigned int flow_ctrl;
index e5538233686813981ede45a029b5722676a5423a..9ec138dc04f95aefa3fb8cbafb8888c56878ba34 100644 (file)
@@ -840,11 +840,11 @@ static void stmmac_adjust_link(struct net_device *dev)
 
                if (!priv->oldlink) {
                        new_state = true;
-                       priv->oldlink = 1;
+                       priv->oldlink = true;
                }
        } else if (priv->oldlink) {
                new_state = true;
-               priv->oldlink = 0;
+               priv->oldlink = false;
                priv->speed = SPEED_UNKNOWN;
                priv->oldduplex = DUPLEX_UNKNOWN;
        }
@@ -907,7 +907,7 @@ static int stmmac_init_phy(struct net_device *dev)
        char bus_id[MII_BUS_ID_SIZE];
        int interface = priv->plat->interface;
        int max_speed = priv->plat->max_speed;
-       priv->oldlink = 0;
+       priv->oldlink = false;
        priv->speed = SPEED_UNKNOWN;
        priv->oldduplex = DUPLEX_UNKNOWN;
 
@@ -4291,7 +4291,7 @@ int stmmac_suspend(struct device *dev)
        }
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       priv->oldlink = 0;
+       priv->oldlink = false;
        priv->speed = SPEED_UNKNOWN;
        priv->oldduplex = DUPLEX_UNKNOWN;
        return 0;