* [PATCH] net: Simplify the calculation of variables
@ 2021-01-22 8:57 Jiapeng Zhong
2021-01-23 3:26 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Zhong @ 2021-01-22 8:57 UTC (permalink / raw)
To: steffen.klassert
Cc: herbert, davem, yoshfuji, kuba, netdev, linux-kernel, Jiapeng Zhong
Fix the following coccicheck warnings:
./net/ipv4/esp4_offload.c:288:32-34: WARNING !A || A && B is
equivalent to !A || B.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
net/ipv4/esp4_offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 5bda5ae..9ba8cc5 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -285,7 +285,7 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_
esp.esph = ip_esp_hdr(skb);
- if (!hw_offload || (hw_offload && !skb_is_gso(skb))) {
+ if (!hw_offload || (!skb_is_gso(skb))) {
esp.nfrags = esp_output_head(x, skb, &esp);
if (esp.nfrags < 0)
return esp.nfrags;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: Simplify the calculation of variables
2021-01-22 8:57 [PATCH] net: Simplify the calculation of variables Jiapeng Zhong
@ 2021-01-23 3:26 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2021-01-23 3:26 UTC (permalink / raw)
To: Jiapeng Zhong
Cc: steffen.klassert, herbert, davem, yoshfuji, netdev, linux-kernel
On Fri, 22 Jan 2021 16:57:47 +0800 Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./net/ipv4/esp4_offload.c:288:32-34: WARNING !A || A && B is
> equivalent to !A || B.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
> net/ipv4/esp4_offload.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
> index 5bda5ae..9ba8cc5 100644
> --- a/net/ipv4/esp4_offload.c
> +++ b/net/ipv4/esp4_offload.c
> @@ -285,7 +285,7 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_
> esp.esph = ip_esp_hdr(skb);
>
>
> - if (!hw_offload || (hw_offload && !skb_is_gso(skb))) {
> + if (!hw_offload || (!skb_is_gso(skb))) {
You can drop the parenthesis around !skb_is_gso(skb) now.
> esp.nfrags = esp_output_head(x, skb, &esp);
> if (esp.nfrags < 0)
> return esp.nfrags;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-23 3:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 8:57 [PATCH] net: Simplify the calculation of variables Jiapeng Zhong
2021-01-23 3:26 ` Jakub Kicinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.