[PATCH] esp6: remove a duplicative condition

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

STALE1972d

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

[PATCH] esp6: remove a duplicative condition

From: angkery <hidden>
Date: 2021-03-11 02:11:03

From: Junlin Yang <redacted>

Fixes coccicheck warnings:
./net/ipv6/esp6_offload.c:319:32-34:
WARNING !A || A && B is equivalent to !A || B

Signed-off-by: Junlin Yang <redacted>
---
 net/ipv6/esp6_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 1ca516f..631c168 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -316,7 +316,7 @@ static int esp6_xmit(struct xfrm_state *x, struct sk_buff *skb,  netdev_features
 	esp.plen = esp.clen - skb->len - esp.tfclen;
 	esp.tailen = esp.tfclen + esp.plen + alen;
 
-	if (!hw_offload || (hw_offload && !skb_is_gso(skb))) {
+	if (!hw_offload || !skb_is_gso(skb)) {
 		esp.nfrags = esp6_output_head(x, skb, &esp);
 		if (esp.nfrags < 0)
 			return esp.nfrags;
-- 
1.9.1

Re: [PATCH] esp6: remove a duplicative condition

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

On Thu, Mar 11, 2021 at 10:07:56AM +0800, angkery wrote:
From: Junlin Yang <redacted>

Fixes coccicheck warnings:
./net/ipv6/esp6_offload.c:319:32-34:
WARNING !A || A && B is equivalent to !A || B

Signed-off-by: Junlin Yang <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