[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6a7fe3d5-9532-c1fb-764a-2e12f98ee914@huawei.com>
Date: Tue, 19 Feb 2019 10:34:04 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: David Miller <davem@...emloft.net>
CC: <yang.wei9@....com.cn>, <netdev@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH net-next] yellowfin: fix remove set but not used variable
warning
On 2019/2/19 4:13, David Miller wrote:
> From: YueHaibing <yuehaibing@...wei.com>
> Date: Mon, 18 Feb 2019 08:15:46 +0000
>
>> @@ -1050,8 +1050,11 @@ static int yellowfin_rx(struct net_device *dev)
>> struct sk_buff *rx_skb = yp->rx_skbuff[entry];
>> s16 frame_status;
>> u16 desc_status;
>> - int data_size, yf_size;
>> + int data_size;
>> u8 *buf_addr;
>> +#ifdef YF_PROTOTYPE
>> + int yf_size = sizeof(struct yellowfin_desc);
>> +#endif
>
> This is just silly.
>
> Please move this variable declaration and initialization into the
> YF_PROTOTYPE basic block in the code below it, like this:
>
> #ifdef YF_PROTOTYPE /* Support for prototype hardware errata. */
> } else if ((yp->flags & HasMACAddrBug) &&
> int yf_size = sizeof(struct yellowfin_desc);
There's just in if condition, define the 'yf_size' seems incorrect
maybe we can remove 'yf_size' and use sizeof directly?
>
> !ether_addr_equal(le32_to_cpu(yp->rx_ring_dma +
> entry * yf_size),
> dev->dev_addr) &&
> !ether_addr_equal(le32_to_cpu(yp->rx_ring_dma +
> entry * yf_size),
> "\377\377\377\377\377\377")) {
> if (bogus_rx++ == 0)
> netdev_warn(dev, "Bad frame to %pM\n",
> buf_addr);
> #endif
>
> Thanks.
>
> .
>
Powered by blists - more mailing lists