diff mbox series

rpl_iptunnel: simplify the return expression of rpl_do_srh()

Message ID 20200818085454.12224-1-vulab@iscas.ac.cn
State Changes Requested
Delegated to: David Miller
Headers show
Series rpl_iptunnel: simplify the return expression of rpl_do_srh() | expand

Commit Message

Xu Wang Aug. 18, 2020, 8:54 a.m. UTC
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(-)

Comments

David Miller Aug. 18, 2020, 7:35 p.m. UTC | #1
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;
diff mbox series

Patch

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)