Skip to contentSkip to conversation

crypto: ccp -A value assigned to a variable is never used.

PATCH In review Jiapeng Chong 3 participants 3 messages Mar 30, 2021 – Apr 9, 2021

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

PATCH 1/1 crypto: ccp -A value assigned to a variable is never used.

Fix the following whitescan warning:

Assigning value "64" to "dst.address" here, but that stored value is overwritten before it can be used.

---
 drivers/crypto/ccp/ccp-ops.c | 1 -
 1 file changed, 1 deletion(-)
drivers/crypto/ccp/ccp-ops.c +0 -1
index d6a8f4e..bb88198 100644
@@ -2418,7 +2418,6 @@ static int ccp_run_ecc_pm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
 	dst.address += CCP_ECC_OUTPUT_SIZE;
 	ccp_reverse_get_dm_area(&dst, 0, ecc->u.pm.result.y, 0,
 				CCP_ECC_MODULUS_BYTES);
-	dst.address += CCP_ECC_OUTPUT_SIZE;
 
 	/* Restore the workarea address */
 	dst.address = save;
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jiapeng Chong

Fix the following whitescan warning:

Assigning value "64" to "dst.address" here, but that stored value is overwritten before it can be used.

Thanks for reporting.

Quoted 21 lines
---
 drivers/crypto/ccp/ccp-ops.c | 1 -
 1 file changed, 1 deletion(-)
drivers/crypto/ccp/ccp-ops.c +0 -1
index d6a8f4e..bb88198 100644
@@ -2418,7 +2418,6 @@ static int ccp_run_ecc_pm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
 	dst.address += CCP_ECC_OUTPUT_SIZE;
 	ccp_reverse_get_dm_area(&dst, 0, ecc->u.pm.result.y, 0,
 				CCP_ECC_MODULUS_BYTES);
-	dst.address += CCP_ECC_OUTPUT_SIZE;
 
 	/* Restore the workarea address */
 	dst.address = save;
Signature · 1 line
1.8.3.1
maintainer
#2 lore raw
In reply to Jiapeng Chong
Quoted 10 lines · Jiapeng Chong

Fix the following whitescan warning:

Assigning value "64" to "dst.address" here, but that stored value is overwritten before it can be used.

---
 drivers/crypto/ccp/ccp-ops.c | 1 -
 1 file changed, 1 deletion(-)

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