Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] rpl_iptunnel: simplify the return expression of rpl_do_srh()
@ 2020-08-18 8:54 Xu Wang
2020-08-18 19:35 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-08-18 8:54 UTC (permalink / raw)
To: davem, kuznet, yoshfuji, kuba, netdev; +Cc: linux-kernel, Xu Wang
Simplify the return expression.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
net/ipv6/rpl_iptunnel.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/ipv6/rpl_iptunnel.c b/net/ipv6/rpl_iptunnel.c
index 5fdf3ebb953f..e58ad9ac987c 100644
--- a/net/ipv6/rpl_iptunnel.c
+++ b/net/ipv6/rpl_iptunnel.c
@@ -197,11 +197,7 @@ static int rpl_do_srh(struct sk_buff *skb, const struct rpl_lwt *rlwt)
tinfo = rpl_encap_lwtunnel(dst->lwtstate);
- err = rpl_do_srh_inline(skb, rlwt, tinfo->srh);
- if (err)
- return err;
-
- return 0;
+ return rpl_do_srh_inline(skb, rlwt, tinfo->srh);
}
static int rpl_output(struct net *net, struct sock *sk, struct sk_buff *skb)
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rpl_iptunnel: simplify the return expression of rpl_do_srh()
2020-08-18 8:54 [PATCH] rpl_iptunnel: simplify the return expression of rpl_do_srh() Xu Wang
@ 2020-08-18 19:35 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-18 19:35 UTC (permalink / raw)
To: vulab; +Cc: kuznet, yoshfuji, kuba, netdev, linux-kernel
From: Xu Wang <vulab@iscas.ac.cn>
Date: Tue, 18 Aug 2020 08:54:54 +0000
> @@ -197,11 +197,7 @@ static int rpl_do_srh(struct sk_buff *skb, const struct rpl_lwt *rlwt)
>
> tinfo = rpl_encap_lwtunnel(dst->lwtstate);
>
> - err = rpl_do_srh_inline(skb, rlwt, tinfo->srh);
> - if (err)
> - return err;
> -
> - return 0;
> + return rpl_do_srh_inline(skb, rlwt, tinfo->srh);
> }
Please at least compile test your changes:
net/ipv6/rpl_iptunnel.c: In function ‘rpl_do_srh’:
net/ipv6/rpl_iptunnel.c:193:6: warning: unused variable ‘err’ [-Wunused-variable]
193 | int err = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-18 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 8:54 [PATCH] rpl_iptunnel: simplify the return expression of rpl_do_srh() Xu Wang
2020-08-18 19:35 ` David Miller
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).