* [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err
@ 2020-05-26 22:49 Colin King
2020-05-26 23:20 ` Eric Biggers
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2020-05-26 22:49 UTC (permalink / raw)
To: Jens Axboe, linux-block; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable err is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
block/blk-crypto-fallback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
index 74ab137ae3ba..6e49688a2d80 100644
--- a/block/blk-crypto-fallback.c
+++ b/block/blk-crypto-fallback.c
@@ -529,7 +529,7 @@ static bool blk_crypto_fallback_inited;
static int blk_crypto_fallback_init(void)
{
int i;
- int err = -ENOMEM;
+ int err;
if (blk_crypto_fallback_inited)
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err
2020-05-26 22:49 [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Colin King
@ 2020-05-26 23:20 ` Eric Biggers
2020-05-26 23:27 ` [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err' Satya Tangirala
2020-05-27 11:42 ` [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2020-05-26 23:20 UTC (permalink / raw)
To: Colin King
Cc: Jens Axboe, linux-block, kernel-janitors, linux-kernel, Satya Tangirala
On Tue, May 26, 2020 at 11:49:02PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable err is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> block/blk-crypto-fallback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
> index 74ab137ae3ba..6e49688a2d80 100644
> --- a/block/blk-crypto-fallback.c
> +++ b/block/blk-crypto-fallback.c
> @@ -529,7 +529,7 @@ static bool blk_crypto_fallback_inited;
> static int blk_crypto_fallback_init(void)
> {
> int i;
> - int err = -ENOMEM;
> + int err;
>
> if (blk_crypto_fallback_inited)
> return 0;
Looks good, you can add:
Reviewed-by: Eric Biggers <ebiggers@google.com>
- Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err'
2020-05-26 22:49 [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Colin King
2020-05-26 23:20 ` Eric Biggers
@ 2020-05-26 23:27 ` Satya Tangirala
2020-05-27 11:42 ` [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Satya Tangirala @ 2020-05-26 23:27 UTC (permalink / raw)
To: Colin King; +Cc: Jens Axboe, linux-block, kernel-janitors, linux-kernel
On Tue, May 26, 2020 at 11:49:02PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable err is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> block/blk-crypto-fallback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
> index 74ab137ae3ba..6e49688a2d80 100644
> --- a/block/blk-crypto-fallback.c
> +++ b/block/blk-crypto-fallback.c
> @@ -529,7 +529,7 @@ static bool blk_crypto_fallback_inited;
> static int blk_crypto_fallback_init(void)
> {
> int i;
> - int err = -ENOMEM;
> + int err;
>
> if (blk_crypto_fallback_inited)
> return 0;
> --
Looks good to me - you can add:
Reviewed-by: Satya Tangirala <satyat@google.com>
Thanks!
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err
2020-05-26 22:49 [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Colin King
2020-05-26 23:20 ` Eric Biggers
2020-05-26 23:27 ` [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err' Satya Tangirala
@ 2020-05-27 11:42 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2020-05-27 11:42 UTC (permalink / raw)
To: Colin King, linux-block; +Cc: kernel-janitors, linux-kernel
On 5/26/20 4:49 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable err is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-27 11:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 22:49 [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Colin King
2020-05-26 23:20 ` Eric Biggers
2020-05-26 23:27 ` [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err' Satya Tangirala
2020-05-27 11:42 ` [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err Jens Axboe
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).