Skip to contentSkip to conversation

esp6: remove redundant variable err

PATCH Applied Colin Ian King 2 participants 2 messages Oct 17, 2022 – Oct 25, 2022

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

PATCH 1/1 esp6: remove redundant variable err

Variable err is being assigned a value that is not read, the assignment is redundant and so is the variable. Remove it.

Cleans up clang scan warning:
net/ipv6/esp6_offload.c:64:7: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err' [deadcode.DeadStores]

---
 net/ipv6/esp6_offload.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/esp6_offload.c +1 -2
index 79d43548279c..97edf461bc72 100644
@@ -56,12 +56,11 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 	__be32 seq;
 	__be32 spi;
 	int nhoff;
-	int err;
 
 	if (!pskb_pull(skb, offset))
 		return NULL;
 
-	if ((err = xfrm_parse_spi(skb, IPPROTO_ESP, &spi, &seq)) != 0)
+	if (xfrm_parse_spi(skb, IPPROTO_ESP, &spi, &seq) != 0)
 		goto out;
 
 	xo = xfrm_offload(skb);
Signature · 1 line
2.37.3
maintainer Applied
#1 lore raw
Quoted 9 lines · Colin Ian King

Variable err is being assigned a value that is not read, the assignment is redundant and so is the variable. Remove it.

Cleans up clang scan warning:
net/ipv6/esp6_offload.c:64:7: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err' [deadcode.DeadStores]

Applied to ipsec-next, thanks!