net: Simplify the calculation of variables
Subsystems (3)
PATCH 1/1 net: Simplify the calculation of variables
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 <[email protected]>
Signed-off-by Jiapeng Zhong <[email protected]>
--- net/ipv4/esp4_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/esp4_offload.c +1 -1
@@ -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;
Signature · 1 line
1.8.3.1
Jakub Kicinski
maintainerQuoted 16 lines · 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 <[email protected]>Signed-off-by Jiapeng Zhong <[email protected]>--- net/ipv4/esp4_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv4/esp4_offload.c +0
-0
net/ipv4/esp4_offload.c static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_ · line 288
Quoted 5 lines
net/ipv4/esp4_offload.c +1
-1@@ -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.
Quoted 3 lines
net/ipv4/esp4_offload.c +0
-0esp.nfrags =esp_output_head (x, skb, &esp);if (esp.nfrags <0 )return esp.nfrags;