netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	<netdev@vger.kernel.org>
Subject: [PATCH 1/7] ipv6/esp6: Remove structure variables and alignment statements
Date: Thu, 6 Jan 2022 10:13:44 +0100	[thread overview]
Message-ID: <20220106091350.3038869-2-steffen.klassert@secunet.com> (raw)
In-Reply-To: <20220106091350.3038869-1-steffen.klassert@secunet.com>

From: luo penghao <luo.penghao@zte.com.cn>

The definition of this variable is just to find the length of the
structure after aligning the structure. The PTR alignment function
is to optimize the size of the structure. In fact, it doesn't seem
to be of much use, because both members of the structure are of
type u32.
So I think that the definition of the variable and the
corresponding alignment can be deleted, the value of extralen can
be directly passed in the size of the structure.

The clang_analyzer complains as follows:

net/ipv6/esp6.c:117:27 warning:

Value stored to 'extra' during its initialization is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index ed2f061b8768..c35c211c9cb7 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -114,7 +114,6 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead,
 
 static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
 {
-	struct esp_output_extra *extra = esp_tmp_extra(tmp);
 	struct crypto_aead *aead = x->data;
 	int extralen = 0;
 	u8 *iv;
@@ -122,7 +121,7 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
 	struct scatterlist *sg;
 
 	if (x->props.flags & XFRM_STATE_ESN)
-		extralen += sizeof(*extra);
+		extralen += sizeof(struct esp_output_extra);
 
 	iv = esp_tmp_iv(aead, tmp, extralen);
 	req = esp_tmp_req(aead, iv);
-- 
2.25.1


  reply	other threads:[~2022-01-06  9:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06  9:13 pull request (net-next): ipsec-next 2022-01-06 Steffen Klassert
2022-01-06  9:13 ` Steffen Klassert [this message]
2022-01-06 12:20   ` [PATCH 1/7] ipv6/esp6: Remove structure variables and alignment statements patchwork-bot+netdevbpf
2022-01-06  9:13 ` [PATCH 2/7] xfrm: Remove duplicate assignment Steffen Klassert
2022-01-06  9:13 ` [PATCH 3/7] net: xfrm: drop check of pols[0] for the second time Steffen Klassert
2022-01-06  9:13 ` [PATCH 4/7] xfrm: update SA curlft.use_time Steffen Klassert
2022-01-06  9:13 ` [PATCH 5/7] xfrm: Add support for SM3 secure hash Steffen Klassert
2022-01-06  9:13 ` [PATCH 6/7] xfrm: Add support for SM4 symmetric cipher algorithm Steffen Klassert
2022-01-06  9:13 ` [PATCH 7/7] xfrm: rate limit SA mapping change message to user space Steffen Klassert
2022-01-06 12:20 ` pull request (net-next): ipsec-next 2022-01-06 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220106091350.3038869-2-steffen.klassert@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).