[PATCH] esp4: Simplify the calculation of variables

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

STALE1967d

2 messages, 2 authors, 2021-03-15 · open the first message on its own page

[PATCH] esp4: Simplify the calculation of variables

From: Jiapeng Chong <hidden>
Date: 2021-03-01 10:48:23

Fix the following coccicheck warnings:

./net/ipv4/esp4.c:757:16-18: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
---
 net/ipv4/esp4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index a3271ec..804a769 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -754,7 +754,7 @@ int esp_input_done2(struct sk_buff *skb, int err)
 	int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
 	int ihl;
 
-	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] esp4: Simplify the calculation of variables

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2021-03-15 10:26:34

On Mon, Mar 01, 2021 at 06:46:02PM +0800, Jiapeng Chong wrote:
Fix the following coccicheck warnings:

./net/ipv4/esp4.c:757:16-18: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
Now 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