All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ipv4: remove redundant assignment to n
@ 2019-05-24 21:56 ` Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2019-05-24 21:56 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer n is being assigned a value however this value is
never read in the code block and the end of the code block
continues to the next loop iteration. Clean up the code by
removing the redundant assignment.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/ipv4/fib_trie.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index ea7df7ebf597..b53ecef89d59 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1961,7 +1961,6 @@ static void __fib_info_notify_update(struct net *net, struct fib_table *tb,
 			if (IS_TRIE(pn))
 				break;
 
-			n = pn;
 			pn = node_parent(pn);
 			cindex = get_index(pkey, pn);
 			continue;
-- 
2.20.1


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

* [PATCH][next] ipv4: remove redundant assignment to n
@ 2019-05-24 21:56 ` Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2019-05-24 21:56 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer n is being assigned a value however this value is
never read in the code block and the end of the code block
continues to the next loop iteration. Clean up the code by
removing the redundant assignment.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/ipv4/fib_trie.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index ea7df7ebf597..b53ecef89d59 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1961,7 +1961,6 @@ static void __fib_info_notify_update(struct net *net, struct fib_table *tb,
 			if (IS_TRIE(pn))
 				break;
 
-			n = pn;
 			pn = node_parent(pn);
 			cindex = get_index(pkey, pn);
 			continue;
-- 
2.20.1

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

* Re: [PATCH][next] ipv4: remove redundant assignment to n
  2019-05-24 21:56 ` Colin King
@ 2019-05-24 22:04   ` David Ahern
  -1 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2019-05-24 22:04 UTC (permalink / raw)
  To: Colin King, David S . Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, netdev
  Cc: kernel-janitors, linux-kernel

On 5/24/19 3:56 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer n is being assigned a value however this value is
> never read in the code block and the end of the code block
> continues to the next loop iteration. Clean up the code by
> removing the redundant assignment.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/ipv4/fib_trie.c | 1 -
>  1 file changed, 1 deletion(-)
> 

This looks right to me -- n should have been dropped. It is used in
fib_trie_free from which I created  __fib_info_notify_update but
__fib_info_notify_update does do the put_child_root or node_free, it
only walks the tree looking for relevant entries that need to send the
NEWROUTE notifications.

Fixes: 1bff1a0c9bbda ("ipv4: Add function to send route updates")
Reviewed-by: David Ahern <dsahern@gmail.com>


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

* Re: [PATCH][next] ipv4: remove redundant assignment to n
@ 2019-05-24 22:04   ` David Ahern
  0 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2019-05-24 22:04 UTC (permalink / raw)
  To: Colin King, David S . Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, netdev
  Cc: kernel-janitors, linux-kernel

On 5/24/19 3:56 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer n is being assigned a value however this value is
> never read in the code block and the end of the code block
> continues to the next loop iteration. Clean up the code by
> removing the redundant assignment.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/ipv4/fib_trie.c | 1 -
>  1 file changed, 1 deletion(-)
> 

This looks right to me -- n should have been dropped. It is used in
fib_trie_free from which I created  __fib_info_notify_update but
__fib_info_notify_update does do the put_child_root or node_free, it
only walks the tree looking for relevant entries that need to send the
NEWROUTE notifications.

Fixes: 1bff1a0c9bbda ("ipv4: Add function to send route updates")
Reviewed-by: David Ahern <dsahern@gmail.com>

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

* Re: [PATCH][next] ipv4: remove redundant assignment to n
  2019-05-24 21:56 ` Colin King
@ 2019-05-27  5:12   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-05-27  5:12 UTC (permalink / raw)
  To: colin.king; +Cc: kuznet, yoshfuji, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Fri, 24 May 2019 22:56:58 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer n is being assigned a value however this value is
> never read in the code block and the end of the code block
> continues to the next loop iteration. Clean up the code by
> removing the redundant assignment.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks Colin.

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

* Re: [PATCH][next] ipv4: remove redundant assignment to n
@ 2019-05-27  5:12   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-05-27  5:12 UTC (permalink / raw)
  To: colin.king; +Cc: kuznet, yoshfuji, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Fri, 24 May 2019 22:56:58 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer n is being assigned a value however this value is
> never read in the code block and the end of the code block
> continues to the next loop iteration. Clean up the code by
> removing the redundant assignment.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks Colin.

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

end of thread, other threads:[~2019-05-27  5:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 21:56 [PATCH][next] ipv4: remove redundant assignment to n Colin King
2019-05-24 21:56 ` Colin King
2019-05-24 22:04 ` David Ahern
2019-05-24 22:04   ` David Ahern
2019-05-27  5:12 ` David Miller
2019-05-27  5:12   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.