* [PATCH][next] crypto: asymmetric_keys: remove redundant pointer secs
@ 2024-01-18 12:07 Colin Ian King
2024-01-19 21:12 ` Jarkko Sakkinen
2024-01-26 9:03 ` Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2024-01-18 12:07 UTC (permalink / raw)
To: David Howells, Herbert Xu, David S . Miller, keyrings, linux-crypto
Cc: kernel-janitors, linux-kernel
The pointer secs is being assigned a value however secs is never
read afterwards. The pointer secs is redundant and can be removed.
Cleans up clang scan build warning:
warning: Although the value stored to 'secs' is used in the enclosing
expression, the value is never actually read from 'secs'
[deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
crypto/asymmetric_keys/verify_pefile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/crypto/asymmetric_keys/verify_pefile.c b/crypto/asymmetric_keys/verify_pefile.c
index f440767bd727..2863984b6700 100644
--- a/crypto/asymmetric_keys/verify_pefile.c
+++ b/crypto/asymmetric_keys/verify_pefile.c
@@ -28,7 +28,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
const struct pe32plus_opt_hdr *pe64;
const struct data_directory *ddir;
const struct data_dirent *dde;
- const struct section_header *secs, *sec;
+ const struct section_header *sec;
size_t cursor, datalen = pelen;
kenter("");
@@ -110,7 +110,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
ctx->n_sections = pe->sections;
if (ctx->n_sections > (ctx->header_size - cursor) / sizeof(*sec))
return -ELIBBAD;
- ctx->secs = secs = pebuf + cursor;
+ ctx->secs = pebuf + cursor;
return 0;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] crypto: asymmetric_keys: remove redundant pointer secs
2024-01-18 12:07 [PATCH][next] crypto: asymmetric_keys: remove redundant pointer secs Colin Ian King
@ 2024-01-19 21:12 ` Jarkko Sakkinen
2024-01-26 9:03 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2024-01-19 21:12 UTC (permalink / raw)
To: Colin Ian King, David Howells, Herbert Xu, David S . Miller,
keyrings, linux-crypto
Cc: kernel-janitors, linux-kernel
On Thu Jan 18, 2024 at 12:07 PM UTC, Colin Ian King wrote:
> The pointer secs is being assigned a value however secs is never
> read afterwards. The pointer secs is redundant and can be removed.
>
> Cleans up clang scan build warning:
> warning: Although the value stored to 'secs' is used in the enclosing
> expression, the value is never actually read from 'secs'
> [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> crypto/asymmetric_keys/verify_pefile.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/crypto/asymmetric_keys/verify_pefile.c b/crypto/asymmetric_keys/verify_pefile.c
> index f440767bd727..2863984b6700 100644
> --- a/crypto/asymmetric_keys/verify_pefile.c
> +++ b/crypto/asymmetric_keys/verify_pefile.c
> @@ -28,7 +28,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
> const struct pe32plus_opt_hdr *pe64;
> const struct data_directory *ddir;
> const struct data_dirent *dde;
> - const struct section_header *secs, *sec;
> + const struct section_header *sec;
> size_t cursor, datalen = pelen;
>
> kenter("");
> @@ -110,7 +110,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
> ctx->n_sections = pe->sections;
> if (ctx->n_sections > (ctx->header_size - cursor) / sizeof(*sec))
> return -ELIBBAD;
> - ctx->secs = secs = pebuf + cursor;
> + ctx->secs = pebuf + cursor;
>
> return 0;
> }
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
BR, Jarkko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] crypto: asymmetric_keys: remove redundant pointer secs
2024-01-18 12:07 [PATCH][next] crypto: asymmetric_keys: remove redundant pointer secs Colin Ian King
2024-01-19 21:12 ` Jarkko Sakkinen
@ 2024-01-26 9:03 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2024-01-26 9:03 UTC (permalink / raw)
To: Colin Ian King
Cc: David Howells, David S . Miller, keyrings, linux-crypto,
kernel-janitors, linux-kernel
On Thu, Jan 18, 2024 at 12:07:45PM +0000, Colin Ian King wrote:
> The pointer secs is being assigned a value however secs is never
> read afterwards. The pointer secs is redundant and can be removed.
>
> Cleans up clang scan build warning:
> warning: Although the value stored to 'secs' is used in the enclosing
> expression, the value is never actually read from 'secs'
> [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> crypto/asymmetric_keys/verify_pefile.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-26 9:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 12:07 [PATCH][next] crypto: asymmetric_keys: remove redundant pointer secs Colin Ian King
2024-01-19 21:12 ` Jarkko Sakkinen
2024-01-26 9:03 ` Herbert Xu
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).