* [PATCH] esp: drop unneeded assignment in esp4_gro_receive()
@ 2021-04-25 10:14 Yang Li
2021-05-25 10:23 ` Steffen Klassert
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-04-25 10:14 UTC (permalink / raw)
To: steffen.klassert
Cc: herbert, davem, yoshfuji, dsahern, kuba, netdev, linux-kernel, Yang Li
Making '!=' operation with 0 directly after calling
the function xfrm_parse_spi() is more efficient,
assignment to err is redundant.
Eliminate the following clang_analyzer warning:
net/ipv4/esp4_offload.c:41:7: warning: Although the value stored to
'err' is used in the enclosing expression, the value is never actually
read from 'err'
No functional change, only more efficient.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
net/ipv4/esp4_offload.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 33687cf..be019a1 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -33,12 +33,11 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
struct xfrm_state *x;
__be32 seq;
__be32 spi;
- int err;
if (!pskb_pull(skb, offset))
return NULL;
- if ((err = xfrm_parse_spi(skb, IPPROTO_ESP, &spi, &seq)) != 0)
+ if (xfrm_parse_spi(skb, IPPROTO_ESP, &spi, &seq) != 0)
goto out;
xo = xfrm_offload(skb);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] esp: drop unneeded assignment in esp4_gro_receive()
2021-04-25 10:14 [PATCH] esp: drop unneeded assignment in esp4_gro_receive() Yang Li
@ 2021-05-25 10:23 ` Steffen Klassert
0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2021-05-25 10:23 UTC (permalink / raw)
To: Yang Li; +Cc: herbert, davem, yoshfuji, dsahern, kuba, netdev, linux-kernel
On Sun, Apr 25, 2021 at 06:14:32PM +0800, Yang Li wrote:
> Making '!=' operation with 0 directly after calling
> the function xfrm_parse_spi() is more efficient,
> assignment to err is redundant.
>
> Eliminate the following clang_analyzer warning:
> net/ipv4/esp4_offload.c:41:7: warning: Although the value stored to
> 'err' is used in the enclosing expression, the value is never actually
> read from 'err'
>
> No functional change, only more efficient.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Now applied to ipsec-next, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-25 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 10:14 [PATCH] esp: drop unneeded assignment in esp4_gro_receive() Yang Li
2021-05-25 10:23 ` Steffen Klassert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).