linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: remove redundant assignment to variable err
@ 2020-09-11 10:35 Colin King
  2020-09-11 14:48 ` David Ahern
  2020-09-11 21:48 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Colin King @ 2020-09-11 10:35 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel

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

The variable err is being initialized with a value that is never read and
it is being updated later with a new value. The initialization is redundant
and can be removed.  Also re-order variable declarations in reverse
Christmas tree ordering.

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

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 5e7e25e2523a..e8ee20720fe0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5284,9 +5284,10 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,
 {
 	struct fib6_config r_cfg;
 	struct rtnexthop *rtnh;
+	int last_err = 0;
 	int remaining;
 	int attrlen;
-	int err = 1, last_err = 0;
+	int err;
 
 	remaining = cfg->fc_mp_len;
 	rtnh = (struct rtnexthop *)cfg->fc_mp;
-- 
2.27.0


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

* Re: [PATCH] ipv6: remove redundant assignment to variable err
  2020-09-11 10:35 [PATCH] ipv6: remove redundant assignment to variable err Colin King
@ 2020-09-11 14:48 ` David Ahern
  2020-09-11 21:48 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Ahern @ 2020-09-11 14:48 UTC (permalink / raw)
  To: Colin King, David S . Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel

On 9/11/20 4:35 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable err is being initialized with a value that is never read and
> it is being updated later with a new value. The initialization is redundant
> and can be removed.  Also re-order variable declarations in reverse
> Christmas tree ordering.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/ipv6/route.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@gmail.com>


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

* Re: [PATCH] ipv6: remove redundant assignment to variable err
  2020-09-11 10:35 [PATCH] ipv6: remove redundant assignment to variable err Colin King
  2020-09-11 14:48 ` David Ahern
@ 2020-09-11 21:48 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2020-09-11 21:48 UTC (permalink / raw)
  To: colin.king; +Cc: kuznet, yoshfuji, kuba, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Fri, 11 Sep 2020 11:35:09 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable err is being initialized with a value that is never read and
> it is being updated later with a new value. The initialization is redundant
> and can be removed.  Also re-order variable declarations in reverse
> Christmas tree ordering.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

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

* Re: [PATCH] ipv6: remove redundant assignment to variable err
  2020-04-15 23:16 Colin King
@ 2020-04-15 23:20 ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-04-15 23:20 UTC (permalink / raw)
  To: colin.king; +Cc: kuznet, yoshfuji, kuba, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Thu, 16 Apr 2020 00:16:30 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable err is being initialized with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks.

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

* [PATCH] ipv6: remove redundant assignment to variable err
@ 2020-04-15 23:16 Colin King
  2020-04-15 23:20 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2020-04-15 23:16 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel

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

The variable err is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

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

diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c
index 75421a472d25..4c7e0a27fa9c 100644
--- a/net/ipv6/seg6.c
+++ b/net/ipv6/seg6.c
@@ -434,7 +434,7 @@ static struct genl_family seg6_genl_family __ro_after_init = {
 
 int __init seg6_init(void)
 {
-	int err = -ENOMEM;
+	int err;
 
 	err = genl_register_family(&seg6_genl_family);
 	if (err)
-- 
2.25.1


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

end of thread, other threads:[~2020-09-11 21:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 10:35 [PATCH] ipv6: remove redundant assignment to variable err Colin King
2020-09-11 14:48 ` David Ahern
2020-09-11 21:48 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2020-04-15 23:16 Colin King
2020-04-15 23:20 ` David Miller

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).