* [PATCH] net: macb: Remove redundant assignment to queue
@ 2021-04-29 10:25 Jiapeng Chong
2021-04-29 16:22 ` Nicolas Ferre
2021-04-29 23:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2021-04-29 10:25 UTC (permalink / raw)
To: nicolas.ferre
Cc: claudiu.beznea, davem, kuba, linux, palmer, paul.walmsley,
netdev, linux-kernel, linux-riscv, Jiapeng Chong
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: macb: Remove redundant assignment to queue
2021-04-29 10:25 [PATCH] net: macb: Remove redundant assignment to queue Jiapeng Chong
@ 2021-04-29 16:22 ` Nicolas Ferre
2021-04-29 23:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2021-04-29 16:22 UTC (permalink / raw)
To: Jiapeng Chong
Cc: claudiu.beznea, kuba, davem, linux, palmer, paul.walmsley,
netdev, linux-kernel, linux-riscv
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: macb: Remove redundant assignment to queue
2021-04-29 10:25 [PATCH] net: macb: Remove redundant assignment to queue Jiapeng Chong
2021-04-29 16:22 ` Nicolas Ferre
@ 2021-04-29 23:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-29 23:00 UTC (permalink / raw)
To: Jiapeng Chong
Cc: nicolas.ferre, claudiu.beznea, davem, kuba, linux, palmer,
paul.walmsley, netdev, linux-kernel, linux-riscv
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 29 Apr 2021 18:25:46 +0800 you 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].
>
> [...]
Here is the summary with links:
- net: macb: Remove redundant assignment to queue
https://git.kernel.org/netdev/net/c/bbf6acea6ecf
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-29 23:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 10:25 [PATCH] net: macb: Remove redundant assignment to queue Jiapeng Chong
2021-04-29 16:22 ` Nicolas Ferre
2021-04-29 23:00 ` patchwork-bot+netdevbpf
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).