Thread (8 messages) flat view 8 messages, 3 authors, 2017-05-23

Re: [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool

From: Joe Perches <joe@perches.com>
Date: 2017-05-22 13:07:54
Also in: lkml

On Mon, 2017-05-22 at 14:33 +0200, Corentin Labbe wrote:
This patch convert new_state from int to bool since it store only 1 or 0
[]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
[]
quoted hunk ↗ jump to hunk
@@ -849,11 +849,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;
It seems oldlink could be bool as well.

drivers/net/ethernet/stmicro/stmmac/stmmac.h:   int oldlink;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:              if (!priv->oldlink) {
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:                      priv->oldlink = 1;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:      } else if (priv->oldlink) {
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:              priv->oldlink = 0;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:      priv->oldlink = 0;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:      priv->oldlink = 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help