From: <zhang.songyi@zte.com.cn>
To: <steffen.klassert@secunet.com>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<zhang.songyi@zte.com.cn>, <jiang.xuexin@zte.com.cn>,
<xue.zhihong@zte.com.cn>
Subject: [PATCH linux-next] net: af_key: remove redundant ret variable
Date: Wed, 2 Nov 2022 21:46:33 +0800 (CST) [thread overview]
Message-ID: <202211022146335400497@zte.com.cn> (raw)
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
next reply other threads:[~2022-11-02 13:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 13:46 zhang.songyi [this message]
2022-11-14 6:43 ` [PATCH linux-next] net: af_key: remove redundant ret variable Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202211022146335400497@zte.com.cn \
--to=zhang.songyi@zte.com.cn \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=jiang.xuexin@zte.com.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
--cc=xue.zhihong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).