lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <1495458463.2093.17.camel@perches.com> Date: Mon, 22 May 2017 06:07:43 -0700 From: Joe Perches <joe@...ches.com> To: Corentin Labbe <clabbe.montjoie@...il.com>, peppe.cavallaro@...com, alexandre.torgue@...com Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool 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 [] > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c [] > @@ -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;
Powered by blists - more mailing lists