[PATCH] esp: Simplify the calculation of variables

Subsystems: networking [general], networking [ipsec], the rest

STALE2012d

2 messages, 2 authors, 2021-02-06 · open the first message on its own page

[PATCH] esp: Simplify the calculation of variables

From: Jiapeng Chong <hidden>
Date: 2021-02-03 02:45:42

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>
---
 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 2b804fc..153ad10 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -788,7 +788,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))
-- 
1.8.3.1

Re: [PATCH] esp: Simplify the calculation of variables

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2021-02-06 07:12:53

On Wed, Feb 03, 2021 at 10:44:30AM +0800, Jiapeng Chong wrote:
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>
Applied to ipsec-next, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help