[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211209013430.409338-1-chi.minghao@zte.com.cn>
Date:   Thu,  9 Dec 2021 01:34:30 +0000
From:   cgel.zte@...il.com
To:     steffen.klassert@...unet.com
Cc:     herbert@...dor.apana.org.au, davem@...emloft.net,
        yoshfuji@...ux-ipv6.org, dsahern@...nel.org, kuba@...nel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        chiminghao <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cm>
Subject: [PATCH] net:ipv6:remove unneeded variable
From: chiminghao <chi.minghao@....com.cn>
return value form directly instead of
taking this in another redundant variable.
Reported-by: Zeal Robot <zealci@....com.cm>
Signed-off-by: chiminghao <chi.minghao@....com.cn>
---
 net/ipv6/esp6.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index ed2f061b8768..c234e028847b 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -413,7 +413,6 @@ static struct ip_esp_hdr *esp6_output_tcp_encap(struct xfrm_state *x,
 						struct esp_info *esp)
 {
 	__be16 *lenp = (void *)esp->esph;
-	struct ip_esp_hdr *esph;
 	unsigned int len;
 	struct sock *sk;
 
@@ -429,9 +428,8 @@ static struct ip_esp_hdr *esp6_output_tcp_encap(struct xfrm_state *x,
 		return ERR_CAST(sk);
 
 	*lenp = htons(len);
-	esph = (struct ip_esp_hdr *)(lenp + 1);
 
-	return esph;
+	return (struct ip_esp_hdr *)(lenp + 1);
 }
 #else
 static struct ip_esp_hdr *esp6_output_tcp_encap(struct xfrm_state *x,
-- 
2.25.1
Powered by blists - more mailing lists
 
