Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646863

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

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool
Date 2017-05-22 15:10 +0200
Message-ID <tJVfX-68S-15@gated-at.bofh.it> (permalink)
References <tJUMV-5Hr-3@gated-at.bofh.it> <tJUMW-5Hr-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] net-next: stmmac: rework the speed selection Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-22 14:40 +0200
  [PATCH v2 2/4] net-next: stmmac: Remove unnecessary parenthesis Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-22 14:40 +0200
  [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-22 14:40 +0200
    Re: [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool Joe Perches <joe@perches.com> - 2017-05-22 15:10 +0200

csiph-web