public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Corentin Labbe <clabbe.montjoie@gmail.com>,
	peppe.cavallaro@st.com, alexandre.torgue@st.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool
Date: Mon, 22 May 2017 06:07:43 -0700	[thread overview]
Message-ID: <1495458463.2093.17.camel@perches.com> (raw)
In-Reply-To: <20170522123347.5295-2-clabbe.montjoie@gmail.com>

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;

  reply	other threads:[~2017-05-22 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 12:33 [PATCH v2 0/4] net-next: stmmac: rework the speed selection Corentin Labbe
2017-05-22 12:33 ` [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool Corentin Labbe
2017-05-22 13:07   ` Joe Perches [this message]
2017-05-22 12:33 ` [PATCH v2 2/4] net-next: stmmac: Remove unnecessary parenthesis Corentin Labbe
2017-05-22 12:33 ` [PATCH v2 3/4] net-next: stmmac: use SPEED_xxx instead of raw value Corentin Labbe
2017-05-22 12:33 ` [PATCH v2 4/4] net-next: stmmac: rework the speed selection Corentin Labbe
2017-05-22 18:49   ` David Miller
2017-05-23  7:10     ` Corentin Labbe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495458463.2093.17.camel@perches.com \
    --to=joe@perches.com \
    --cc=alexandre.torgue@st.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox