mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] esp: Simplify the calculation of variables
@ 2021-02-03  2:44 Jiapeng Chong
  2021-02-06  7:11 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-02-03  2:44 UTC (permalink / raw)
  To: steffen.klassert
  Cc: herbert, davem, yoshfuji, dsahern, kuba, netdev, linux-kernel,
	Jiapeng Chong

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 <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.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 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] esp: Simplify the calculation of variables
  2021-02-03  2:44 [PATCH] esp: Simplify the calculation of variables Jiapeng Chong
@ 2021-02-06  7:11 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2021-02-06  7:11 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: herbert, davem, yoshfuji, dsahern, kuba, netdev, linux-kernel

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 <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied to ipsec-next, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-06  7:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  2:44 [PATCH] esp: Simplify the calculation of variables Jiapeng Chong
2021-02-06  7:11 ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®