From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: <claudiu.beznea@microchip.com>, <kuba@kernel.org>,
<davem@davemloft.net>, <linux@armlinux.org.uk>,
<palmer@dabbelt.com>, <paul.walmsley@sifive.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH] net: macb: Remove redundant assignment to queue
Date: Thu, 29 Apr 2021 18:22:33 +0200 [thread overview]
Message-ID: <8c969699-6ce3-4731-e33c-2d1b045aafab@microchip.com> (raw)
In-Reply-To: <1619691946-90305-1-git-send-email-jiapeng.chong@linux.alibaba.com>
On 29/04/2021 at 12:25, Jiapeng Chong wrote:
> Variable queue is set to bp->queues but these values is not used as it
> is overwritten later on, hence redundant assignment can be removed.
>
> Cleans up the following clang-analyzer warning:
>
> drivers/net/ethernet/cadence/macb_main.c:4919:21: warning: Value stored
> to 'queue' during its initialization is never read
> [clang-analyzer-deadcode.DeadStores].
>
> drivers/net/ethernet/cadence/macb_main.c:4832:21: warning: Value stored
> to 'queue' during its initialization is never read
> [clang-analyzer-deadcode.DeadStores].
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Looks good to me as assignments are done in for loops:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Regards,
Nicolas
> ---
> drivers/net/ethernet/cadence/macb_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 0f6a6cb..5693850 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4829,7 +4829,7 @@ static int __maybe_unused macb_suspend(struct device *dev)
> {
> struct net_device *netdev = dev_get_drvdata(dev);
> struct macb *bp = netdev_priv(netdev);
> - struct macb_queue *queue = bp->queues;
> + struct macb_queue *queue;
> unsigned long flags;
> unsigned int q;
> int err;
> @@ -4916,7 +4916,7 @@ static int __maybe_unused macb_resume(struct device *dev)
> {
> struct net_device *netdev = dev_get_drvdata(dev);
> struct macb *bp = netdev_priv(netdev);
> - struct macb_queue *queue = bp->queues;
> + struct macb_queue *queue;
> unsigned long flags;
> unsigned int q;
> int err;
> --
> 1.8.3.1
>
--
Nicolas Ferre
next prev parent reply other threads:[~2021-04-29 16:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 10:25 [PATCH] net: macb: Remove redundant assignment to queue Jiapeng Chong
2021-04-29 16:22 ` Nicolas Ferre [this message]
2021-04-29 23:00 ` patchwork-bot+netdevbpf
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=8c969699-6ce3-4731-e33c-2d1b045aafab@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=claudiu.beznea@microchip.com \
--cc=davem@davemloft.net \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.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).