mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net/ipv6: remove redundant err variable
@ 2022-01-12  8:26 cgel.zte
  2022-01-12 15:54 ` David Ahern
  0 siblings, 1 reply; 7+ messages in thread
From: cgel.zte @ 2022-01-12  8:26 UTC (permalink / raw)
  To: davem
  Cc: yoshfuji, dsahern, kuba, netdev, linux-kernel, Minghao Chi,
	Zeal Robot, CGEL ZTE

From: Minghao Chi <chi.minghao@zte.com.cn>

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

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 net/ipv6/ip6_tunnel.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index fe786df4f849..897194eb3b89 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -698,13 +698,12 @@ mplsip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	    u8 type, u8 code, int offset, __be32 info)
 {
 	__u32 rel_info = ntohl(info);
-	int err, rel_msg = 0;
+	int rel_msg = 0;
 	u8 rel_type = type;
 	u8 rel_code = code;
 
-	err = ip6_tnl_err(skb, IPPROTO_MPLS, opt, &rel_type, &rel_code,
+	return ip6_tnl_err(skb, IPPROTO_MPLS, opt, &rel_type, &rel_code,
 			  &rel_msg, &rel_info, offset);
-	return err;
 }
 
 static int ip4ip6_dscp_ecn_decapsulate(const struct ip6_tnl *t,
-- 
2.25.1


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

end of thread, other threads:[~2022-01-19 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12  8:26 [PATCH] net/ipv6: remove redundant err variable cgel.zte
2022-01-12 15:54 ` David Ahern
2022-01-12 16:39   ` Jakub Kicinski
2022-01-19  3:00     ` cgel.zte
2022-01-19  3:28       ` Jakub Kicinski
2022-01-19  5:55         ` cgel.zte
2022-01-19 15:59           ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®