[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191007.161426.108032588372697075.davem@davemloft.net>
Date: Mon, 07 Oct 2019 16:14:26 +0200 (CEST)
From: David Miller <davem@...emloft.net>
To: Jose.Abreu@...opsys.com
Cc: netdev@...r.kernel.org, Joao.Pinto@...opsys.com,
peppe.cavallaro@...com, alexandre.torgue@...com,
mcoquelin.stm32@...il.com,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: stmmac: Fix sparse warning
From: Jose Abreu <Jose.Abreu@...opsys.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.
Powered by blists - more mailing lists