linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] neighbour: Remove redundant initialization of 'bucket'
@ 2021-05-08 10:03 Yang Li
  2021-05-10 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-05-08 10:03 UTC (permalink / raw)
  To: davem
  Cc: kuba, nathan, ndesaulniers, netdev, linux-kernel,
	clang-built-linux, Yang Li

Integer variable 'bucket' is being initialized however
this value is never read as 'bucket' is assigned zero
in for statement. Remove the redundant assignment.

Cleans up clang warning:

net/core/neighbour.c:3144:6: warning: Value stored to 'bucket' during
its initialization is never read [clang-analyzer-deadcode.DeadStores]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 net/core/neighbour.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 98f20efb..2b2f333 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3141,7 +3141,7 @@ static struct pneigh_entry *pneigh_get_first(struct seq_file *seq)
 	struct net *net = seq_file_net(seq);
 	struct neigh_table *tbl = state->tbl;
 	struct pneigh_entry *pn = NULL;
-	int bucket = state->bucket;
+	int bucket;
 
 	state->flags |= NEIGH_SEQ_IS_PNEIGH;
 	for (bucket = 0; bucket <= PNEIGH_HASHMASK; bucket++) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] neighbour: Remove redundant initialization of 'bucket'
  2021-05-08 10:03 [PATCH] neighbour: Remove redundant initialization of 'bucket' Yang Li
@ 2021-05-10 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-10 21:30 UTC (permalink / raw)
  To: Yang Li
  Cc: davem, kuba, nathan, ndesaulniers, netdev, linux-kernel,
	clang-built-linux

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sat,  8 May 2021 18:03:05 +0800 you wrote:
> Integer variable 'bucket' is being initialized however
> this value is never read as 'bucket' is assigned zero
> in for statement. Remove the redundant assignment.
> 
> Cleans up clang warning:
> 
> net/core/neighbour.c:3144:6: warning: Value stored to 'bucket' during
> its initialization is never read [clang-analyzer-deadcode.DeadStores]
> 
> [...]

Here is the summary with links:
  - neighbour: Remove redundant initialization of 'bucket'
    https://git.kernel.org/netdev/net-next/c/48de7c0c1c92

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] 2+ messages in thread

end of thread, other threads:[~2021-05-10 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08 10:03 [PATCH] neighbour: Remove redundant initialization of 'bucket' Yang Li
2021-05-10 21:30 ` 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).