[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240822043252.3488749-9-lizetao1@huawei.com>
Date: Thu, 22 Aug 2024 12:32:50 +0800
From: Li Zetao <lizetao1@...wei.com>
To: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <dsahern@...nel.org>, <idosch@...dia.com>,
<amcohen@...dia.com>, <petrm@...dia.com>, <gnault@...hat.com>,
<b.galvani@...il.com>, <alce@...ranque.net>, <shaozhengchao@...wei.com>,
<horms@...nel.org>, <lizetao1@...wei.com>, <j.granados@...sung.com>,
<linux@...ssschuh.net>, <judyhsiao@...omium.org>, <jiri@...nulli.us>
CC: <netdev@...r.kernel.org>
Subject: [PATCH net-next 08/10] ip6mr: delete redundant judgment statements
The initial value of err is -ENOBUFS, and err is guaranteed to be
less than 0 before all goto errout. Therefore, on the error path
of errout, there is no need to repeatedly judge that err is less than 0,
and delete redundant judgments to make the code more concise.
Signed-off-by: Li Zetao <lizetao1@...wei.com>
---
net/ipv6/ip6mr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index dd342e6ecf3f..e3ee93c562c3 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -2431,8 +2431,7 @@ static void mr6_netlink_event(struct mr_table *mrt, struct mfc6_cache *mfc,
errout:
kfree_skb(skb);
- if (err < 0)
- rtnl_set_sk_err(net, RTNLGRP_IPV6_MROUTE, err);
+ rtnl_set_sk_err(net, RTNLGRP_IPV6_MROUTE, err);
}
static size_t mrt6msg_netlink_msgsize(size_t payloadlen)
--
2.34.1
Powered by blists - more mailing lists