diff mbox series

ipv6: remove redundant store to value after addition

Message ID 20220628145406.183527-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit 74fd304f2395e574a21cd06912f860771c82ee88
Delegated to: Netdev Maintainers
Headers show
Series ipv6: remove redundant store to value after addition | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/cc_maintainers warning 4 maintainers not CCed: trix@redhat.com llvm@lists.linux.dev ndesaulniers@google.com nathan@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Colin Ian King June 28, 2022, 2:54 p.m. UTC
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(-)

Comments

David Ahern June 28, 2022, 3:04 p.m. UTC | #1
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>
patchwork-bot+netdevbpf@kernel.org June 30, 2022, 4 a.m. UTC | #2
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!
diff mbox series

Patch

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;