[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240822043252.3488749-11-lizetao1@huawei.com>
Date: Thu, 22 Aug 2024 12:32:52 +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 10/10] net: mpls: 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/mpls/af_mpls.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 0e6c94a8c2bc..aba983531ed3 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1201,8 +1201,7 @@ static void mpls_netconf_notify_devconf(struct net *net, int event,
rtnl_notify(skb, net, 0, RTNLGRP_MPLS_NETCONF, NULL, GFP_KERNEL);
return;
errout:
- if (err < 0)
- rtnl_set_sk_err(net, RTNLGRP_MPLS_NETCONF, err);
+ rtnl_set_sk_err(net, RTNLGRP_MPLS_NETCONF, err);
}
static const struct nla_policy devconf_mpls_policy[NETCONFA_MAX + 1] = {
@@ -2278,8 +2277,7 @@ static void rtmsg_lfib(int event, u32 label, struct mpls_route *rt,
return;
errout:
- if (err < 0)
- rtnl_set_sk_err(net, RTNLGRP_MPLS_ROUTE, err);
+ rtnl_set_sk_err(net, RTNLGRP_MPLS_ROUTE, err);
}
static int mpls_valid_getroute_req(struct sk_buff *skb,
--
2.34.1
Powered by blists - more mailing lists