linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: Jose.Abreu@synopsys.com
Cc: netdev@vger.kernel.org, Joao.Pinto@synopsys.com,
	peppe.cavallaro@st.com, alexandre.torgue@st.com,
	mcoquelin.stm32@gmail.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: stmmac: Fix sparse warning
Date: Mon, 07 Oct 2019 16:14:26 +0200 (CEST)	[thread overview]
Message-ID: <20191007.161426.108032588372697075.davem@davemloft.net> (raw)
In-Reply-To: <b59904022c2f96aca956aa693040faf0dddeb802.1570454078.git.Jose.Abreu@synopsys.com>

From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Mon,  7 Oct 2019 15:16:08 +0200

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 8b76745a7ec4..40b0756f3a14 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -4207,6 +4207,7 @@ static u32 stmmac_vid_crc32_le(__le16 vid_le)
>  static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
>  {
>  	u32 crc, hash = 0;
> +	__le16 pmatch = 0;
>  	int count = 0;
>  	u16 vid = 0;
>  
> @@ -4221,11 +4222,11 @@ static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
>  		if (count > 2) /* VID = 0 always passes filter */
>  			return -EOPNOTSUPP;
>  
> -		vid = cpu_to_le16(vid);
> +		pmatch = cpu_to_le16(vid);
>  		hash = 0;
>  	}
>  
> -	return stmmac_update_vlan_hash(priv, priv->hw, hash, vid, is_double);
> +	return stmmac_update_vlan_hash(priv, priv->hw, hash, pmatch, is_double);
>  }

I dunno about this.

The original code would use the last "vid" iterated over in the
for_each_set_bit() loop if the priv->dma_cap.vlhash test does not
pass.

Now, it will use zero in that case.

This does not look like an equivalent transformation.

  reply	other threads:[~2019-10-07 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 13:16 [PATCH net-next] net: stmmac: Fix sparse warning Jose Abreu
2019-10-07 14:14 ` David Miller [this message]
2019-10-07 15:22   ` Jose Abreu

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=20191007.161426.108032588372697075.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).