# \[PATCH 3/4\] esp: Simplify the calculation of variables

- From: Steffen Klassert \<steffen.klassert@secunet.com\>
- Date: 2021-02-09 09:46:31 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/02/11196208
- Thread: https://ratatoskr.run/netdev/2021/02/11196207/t.md

```text
From: Jiapeng Chong <redacted>

Fix the following coccicheck warnings:

./net/ipv6/esp6.c:791:16-18: WARNING !A || A && B is equivalent
to !A || B.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 52c2f063529f..53eb76b1e708 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -793,7 +793,7 @@ int esp6_input_done2(struct sk_buff *skb, int err)
 	int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
 	int hdr_len = skb_network_header_len(skb);
 
-	if (!xo || (xo && !(xo->flags & CRYPTO_DONE)))
+	if (!xo || !(xo->flags & CRYPTO_DONE))
 		kfree(ESP_SKB_CB(skb)->tmp);
 
 	if (unlikely(err))
-- 
2.25.1

```
