Skip to contentSkip to conversation

crypto: x86/des: remove redundant assignment of variable nbytes

PATCH In review Colin Ian King 2 participants 2 messages Dec 7, 2021 – Dec 17, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: x86/des: remove redundant assignment of variable nbytes

The variable nbytes is being assigned a value that is never read, it is being re-assigned in the following statement. The assignment is redundant and can be removed.

---
 arch/x86/crypto/des3_ede_glue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/crypto/des3_ede_glue.c +2 -2
index e7cb68a3db3b..787c234d2469 100644
@@ -164,7 +164,7 @@ static int cbc_encrypt(struct skcipher_request *req)
 
 	err = skcipher_walk_virt(&walk, req, false);
 
-	while ((nbytes = walk.nbytes)) {
+	while (walk.nbytes) {
 		nbytes = __cbc_encrypt(ctx, &walk);
 		err = skcipher_walk_done(&walk, nbytes);
 	}
@@ -243,7 +243,7 @@ static int cbc_decrypt(struct skcipher_request *req)
 
 	err = skcipher_walk_virt(&walk, req, false);
 
-	while ((nbytes = walk.nbytes)) {
+	while (walk.nbytes) {
 		nbytes = __cbc_decrypt(ctx, &walk);
 		err = skcipher_walk_done(&walk, nbytes);
 	}
Signature · 1 line
2.33.1
maintainer
#1 lore raw
Quoted 8 lines · Colin Ian King

The variable nbytes is being assigned a value that is never read, it is being re-assigned in the following statement. The assignment is redundant and can be removed.

---
 arch/x86/crypto/des3_ede_glue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt