linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] esp6: remove redundant variable err
@ 2022-10-17 22:08 Colin Ian King
  2022-10-25  8:23 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-10-17 22:08 UTC (permalink / raw)
  To: Steffen Klassert, Herbert Xu, David S . Miller,
	Hideaki YOSHIFUJI, David Ahern, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev
  Cc: kernel-janitors, linux-kernel

Variable err is being assigned a value that is not read, the assignment
is redundant and so is the variable. Remove it.

Cleans up clang scan warning:
net/ipv6/esp6_offload.c:64:7: warning: Although the value stored to 'err'
is used in the enclosing expression, the value is never actually read
from 'err' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 net/ipv6/esp6_offload.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 79d43548279c..97edf461bc72 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -56,12 +56,11 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 	__be32 seq;
 	__be32 spi;
 	int nhoff;
-	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);
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] esp6: remove redundant variable err
  2022-10-17 22:08 [PATCH] esp6: remove redundant variable err Colin Ian King
@ 2022-10-25  8:23 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2022-10-25  8:23 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Herbert Xu, David S . Miller, Hideaki YOSHIFUJI, David Ahern,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev,
	kernel-janitors, linux-kernel

On Mon, Oct 17, 2022 at 11:08:09PM +0100, Colin Ian King wrote:
> Variable err is being assigned a value that is not read, the assignment
> is redundant and so is the variable. Remove it.
> 
> Cleans up clang scan warning:
> net/ipv6/esp6_offload.c:64:7: warning: Although the value stored to 'err'
> is used in the enclosing expression, the value is never actually read
> from 'err' [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied to ipsec-next, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-25  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 22:08 [PATCH] esp6: remove redundant variable err Colin Ian King
2022-10-25  8: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).