block: blk-crypto-fallback: remove redundant initialization of variable err
Subsystems (2)
PATCH 1/1 block: blk-crypto-fallback: remove redundant initialization of variable err
From: Colin Ian King <[email protected]>
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")
--- block/blk-crypto-fallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-crypto-fallback.c +1 -1
@@ -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 ;
Signature · 1 line
2.25.1
Quoted 17 lines · Colin King
From: Colin Ian King <[email protected]>
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 <[email protected]>--- block/blk-crypto-fallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/blk-crypto-fallback.c +0
-0
block/blk-crypto-fallback.c static bool blk_crypto_fallback_inited; · line 535
Quoted 8 lines
block/blk-crypto-fallback.c +1
-1@@ -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:
- Eric
Re: [PATCH][next] block: blk-crypto-fallback: remove redundant initialization of variable err'
In reply to Colin KingQuoted 18 lines · Colin King
From: Colin Ian King <[email protected]>
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 <[email protected]>--- block/blk-crypto-fallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/blk-crypto-fallback.c +0
-0
block/blk-crypto-fallback.c static bool blk_crypto_fallback_inited; · line 535
Quoted 8 lines
block/blk-crypto-fallback.c +1
-1@@ -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:
Thanks!
Quoted 2 lines
2.25.1
Quoted 5 lines · Colin King
From: Colin Ian King <[email protected]>
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.
Signature · 1 line
Jens Axboe