mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ipv6: remove redundant store to value after addition
@ 2022-06-28 14:54 Colin Ian King
  2022-06-28 15:04 ` David Ahern
  2022-06-30  4:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2022-06-28 14:54 UTC (permalink / raw)
  To: David S . Miller, Hideaki YOSHIFUJI, David Ahern, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev
  Cc: kernel-janitors, linux-kernel

There is no need to store the result of the addition back to variable count
after the addition. The store is redundant, replace += with just +

Cleans up clang scan build warning:
warning: Although the value stored to 'count' is used in the enclosing
expression, the value is never actually read from 'count'

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0be01a4d48c1..1d6f75eef4bd 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5934,7 +5934,7 @@ int rt6_dump_route(struct fib6_info *rt, void *p_arg, unsigned int skip)
 		rcu_read_unlock();
 
 		if (err)
-			return count += w.count;
+			return count + w.count;
 	}
 
 	return -1;
-- 
2.35.3


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

* Re: [PATCH] ipv6: remove redundant store to value after addition
  2022-06-28 14:54 [PATCH] ipv6: remove redundant store to value after addition Colin Ian King
@ 2022-06-28 15:04 ` David Ahern
  2022-06-30  4:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2022-06-28 15:04 UTC (permalink / raw)
  To: Colin Ian King, David S . Miller, Hideaki YOSHIFUJI,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev
  Cc: kernel-janitors, linux-kernel

On 6/28/22 8:54 AM, Colin Ian King wrote:
> There is no need to store the result of the addition back to variable count
> after the addition. The store is redundant, replace += with just +
> 
> Cleans up clang scan build warning:
> warning: Although the value stored to 'count' is used in the enclosing
> expression, the value is never actually read from 'count'
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  net/ipv6/route.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>


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

* Re: [PATCH] ipv6: remove redundant store to value after addition
  2022-06-28 14:54 [PATCH] ipv6: remove redundant store to value after addition Colin Ian King
  2022-06-28 15:04 ` David Ahern
@ 2022-06-30  4:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-30  4:00 UTC (permalink / raw)
  To: Colin Ian King
  Cc: davem, yoshfuji, dsahern, edumazet, kuba, pabeni, netdev,
	kernel-janitors, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 28 Jun 2022 15:54:06 +0100 you wrote:
> There is no need to store the result of the addition back to variable count
> after the addition. The store is redundant, replace += with just +
> 
> Cleans up clang scan build warning:
> warning: Although the value stored to 'count' is used in the enclosing
> expression, the value is never actually read from 'count'
> 
> [...]

Here is the summary with links:
  - ipv6: remove redundant store to value after addition
    https://git.kernel.org/netdev/net-next/c/74fd304f2395

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:[~2022-06-30  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 14:54 [PATCH] ipv6: remove redundant store to value after addition Colin Ian King
2022-06-28 15:04 ` David Ahern
2022-06-30  4: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

all inboxes | Powered by JetHome®