Skip to contentSkip to conversation

net: af_key: remove redundant ret variable

PATCH In review [email protected] 2 participants 2 messages Nov 2, 2022 – Nov 14, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: af_key: remove redundant ret variable

From a09ddf4bd144610fd17bdbf07f0c27700d805e6f Mon Sep 17 00:00:00 2001
From: zhang songyi <[email protected]>
Date: Wed, 2 Nov 2022 21:05:39 +0800
Subject: [PATCH linux-next] net: af_key: remove redundant ret variable

Return value from pfkey_net_init() directly instead of taking this in another redundant variable.

---
 net/key/af_key.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
net/key/af_key.c +1 -4
index 213287814328..ec37825b1c15 100644
@@ -3863,14 +3863,11 @@ static struct xfrm_mgr pfkeyv2_mgr =
 static int __net_init pfkey_net_init(struct net *net)
 {
    struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id);
-   int rv;
 
    INIT_HLIST_HEAD(&net_pfkey->table);
    atomic_set(&net_pfkey->socks_nr, 0);
 
-   rv = pfkey_init_proc(net);
-
-   return rv;
+   return pfkey_init_proc(net);
 }
 
 static void __net_exit pfkey_net_exit(struct net *net)

--
2.15.2

maintainer
#1 lore raw
Quoted 10 lines · On Wed, Nov 02, 2022 at 09:46:33PM +0800, [email protected] wrote:
Quoted 1 line

From a09ddf4bd144610fd17bdbf07f0c27700d805e6f Mon Sep 17 00:00:00 2001

From: zhang songyi <[email protected]>
Date: Wed, 2 Nov 2022 21:05:39 +0800
Subject: [PATCH linux-next] net: af_key: remove redundant ret variable

Return value from pfkey_net_init() directly instead of taking this in another redundant variable.

pfkey is deprecated and should not be used anymore. Please do changes to pfkey just if there is a real bug to fix.

Thanks!