diff mbox series

[1/7] ipv6/esp6: Remove structure variables and alignment statements

Message ID 20220106091350.3038869-2-steffen.klassert@secunet.com (mailing list archive)
State Accepted
Commit c6e7871894a3b975ae45995d69cf761566904595
Delegated to: Netdev Maintainers
Headers show
Series [1/7] ipv6/esp6: Remove structure variables and alignment statements | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Pull request is its own cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: dsahern@kernel.org yoshfuji@linux-ipv6.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Steffen Klassert Jan. 6, 2022, 9:13 a.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 6, 2022, 12:20 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by Steffen Klassert <steffen.klassert@secunet.com>:

On Thu, 6 Jan 2022 10:13:44 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [1/7] ipv6/esp6: Remove structure variables and alignment statements
    https://git.kernel.org/netdev/net-next/c/c6e7871894a3
  - [2/7] xfrm: Remove duplicate assignment
    https://git.kernel.org/netdev/net-next/c/2e1809208a4a
  - [3/7] net: xfrm: drop check of pols[0] for the second time
    https://git.kernel.org/netdev/net-next/c/ac1077e92825
  - [4/7] xfrm: update SA curlft.use_time
    https://git.kernel.org/netdev/net-next/c/af734a26a1a9
  - [5/7] xfrm: Add support for SM3 secure hash
    https://git.kernel.org/netdev/net-next/c/e6911affa416
  - [6/7] xfrm: Add support for SM4 symmetric cipher algorithm
    https://git.kernel.org/netdev/net-next/c/23b6a6df94c6
  - [7/7] xfrm: rate limit SA mapping change message to user space
    https://git.kernel.org/netdev/net-next/c/4e484b3e969b

You are awesome, thank you!
diff mbox series

Patch

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);