* [PATCH] net: ipv4: remove redundant assignment to variable rc
@ 2020-04-20 21:51 Colin King
2020-04-20 23:27 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-04-20 21:51 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 rc is being assigned 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/ipv4/af_inet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index cf58e29cf746..c618e242490f 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1914,7 +1914,7 @@ static int __init inet_init(void)
{
struct inet_protosw *q;
struct list_head *r;
- int rc = -EINVAL;
+ int rc;
sock_skb_cb_check_size(sizeof(struct inet_skb_parm));
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ipv4: remove redundant assignment to variable rc
2020-04-20 21:51 [PATCH] net: ipv4: remove redundant assignment to variable rc Colin King
@ 2020-04-20 23:27 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-20 23:27 UTC (permalink / raw)
To: colin.king; +Cc: kuznet, yoshfuji, kuba, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Mon, 20 Apr 2020 22:51:49 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable rc is being assigned 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 to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-20 23:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 21:51 [PATCH] net: ipv4: remove redundant assignment to variable rc Colin King
2020-04-20 23:27 ` 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).