diff mbox series

esp4: Simplify the calculation of variables

Message ID 1614595562-56960-1-git-send-email-jiapeng.chong@linux.alibaba.com
State New
Headers show
Series esp4: Simplify the calculation of variables | expand

Commit Message

Jiapeng Chong March 1, 2021, 10:46 a.m. UTC
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 <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 net/ipv4/esp4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steffen Klassert March 15, 2021, 10:25 a.m. UTC | #1
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 <abaci@linux.alibaba.com>

> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>


Now applied to ipsec-next, thanks!
diff mbox series

Patch

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))