netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] net: af_key: remove redundant ret variable
@ 2022-11-02 13:46 zhang.songyi
  2022-11-14  6:43 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: zhang.songyi @ 2022-11-02 13:46 UTC (permalink / raw)
  To: steffen.klassert
  Cc: herbert, davem, edumazet, kuba, pabeni, netdev, linux-kernel,
	zhang.songyi, jiang.xuexin, xue.zhihong

From a09ddf4bd144610fd17bdbf07f0c27700d805e6f Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.com.cn>
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.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 net/key/af_key.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 213287814328..ec37825b1c15 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -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

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

* Re: [PATCH linux-next] net: af_key: remove redundant ret variable
  2022-11-02 13:46 [PATCH linux-next] net: af_key: remove redundant ret variable zhang.songyi
@ 2022-11-14  6:43 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2022-11-14  6:43 UTC (permalink / raw)
  To: zhang.songyi
  Cc: herbert, davem, edumazet, kuba, pabeni, netdev, linux-kernel,
	jiang.xuexin, xue.zhihong

On Wed, Nov 02, 2022 at 09:46:33PM +0800, zhang.songyi@zte.com.cn wrote:
> >From a09ddf4bd144610fd17bdbf07f0c27700d805e6f Mon Sep 17 00:00:00 2001
> From: zhang songyi <zhang.songyi@zte.com.cn>
> 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.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>

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

Thanks!

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

end of thread, other threads:[~2022-11-14  6:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 13:46 [PATCH linux-next] net: af_key: remove redundant ret variable zhang.songyi
2022-11-14  6:43 ` Steffen Klassert

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