diff mbox series

esp6: Simplify the calculation of variables

Message ID 1618307835-83161-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series esp6: Simplify the calculation of variables | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Jiapeng Chong April 13, 2021, 9:57 a.m. UTC
Fix the following coccicheck warnings:

./net/ipv6/esp6_offload.c:321:32-34: 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_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steffen Klassert April 14, 2021, 10:11 a.m. UTC | #1
On Tue, Apr 13, 2021 at 05:57:15PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
> 
> ./net/ipv6/esp6_offload.c:321:32-34: 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_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 4af56af..40ed4fc 100644
> --- a/net/ipv6/esp6_offload.c
> +++ b/net/ipv6/esp6_offload.c
> @@ -318,7 +318,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;

That one is already in ipsec-next:

Commit f076835a8bf2aa6ea48f718e4506587c815ab99f
Author: Junlin Yang <yangjunlin@yulong.com>
Date:   Thu Mar 11 10:07:56 2021 +0800

    esp6: remove a duplicative condition

    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 <yangjunlin@yulong.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
diff mbox series

Patch

diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 4af56af..40ed4fc 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -318,7 +318,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;