Skip to contentSkip to conversation

net:ipv6:remove unneeded variable

PATCH New [email protected] 1 participant 1 message Dec 9, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net:ipv6:remove unneeded variable

From: chiminghao <[email protected]>

return value form directly instead of
taking this in another redundant variable.

---
 net/ipv6/esp6.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/ipv6/esp6.c +1 -3
index ed2f061b8768..c234e028847b 100644
@@ -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,
Signature · 1 line
2.25.1