diff mbox series

net:ipv6:remove unneeded variable

Message ID 20211209013430.409338-1-chi.minghao@zte.com.cn (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series net:ipv6:remove unneeded variable | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

CGEL Dec. 9, 2021, 1:34 a.m. UTC
From: chiminghao <chi.minghao@zte.com.cn>

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

Reported-by: Zeal Robot <zealci@zte.com.cm>
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
---
 net/ipv6/esp6.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

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,