linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: aspeed: fix uninitialized symbol 'idx' warning
@ 2023-03-01  3:32 Neal Liu
  2023-03-10 11:32 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Neal Liu @ 2023-03-01  3:32 UTC (permalink / raw)
  To: Joel Stanley, Andrew Jeffery, Neal Liu, Herbert Xu, David S . Miller
  Cc: linux-arm-kernel, linux-aspeed, linux-kernel, linux-crypto,
	kernel test robot, Dan Carpenter

'idx' is not initialized if it's not EXP_MODE nor MOD_MODE.
Use "else" instead to fix it.

Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202302261052.CVFRyq6F-lkp@intel.com/

---
 drivers/crypto/aspeed/aspeed-acry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/aspeed/aspeed-acry.c b/drivers/crypto/aspeed/aspeed-acry.c
index 1f77ebd73489..828dc3ae1b5f 100644
--- a/drivers/crypto/aspeed/aspeed-acry.c
+++ b/drivers/crypto/aspeed/aspeed-acry.c
@@ -289,7 +289,7 @@ static int aspeed_acry_rsa_ctx_copy(struct aspeed_acry_dev *acry_dev, void *buf,
 
 			if (mode == ASPEED_RSA_EXP_MODE)
 				idx = acry_dev->exp_dw_mapping[j - 1];
-			else if (mode == ASPEED_RSA_MOD_MODE)
+			else /* mode == ASPEED_RSA_MOD_MODE */
 				idx = acry_dev->mod_dw_mapping[j - 1];
 
 			dw_buf[idx] = cpu_to_le32(data);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: aspeed: fix uninitialized symbol 'idx' warning
  2023-03-01  3:32 [PATCH] crypto: aspeed: fix uninitialized symbol 'idx' warning Neal Liu
@ 2023-03-10 11:32 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2023-03-10 11:32 UTC (permalink / raw)
  To: Neal Liu
  Cc: Joel Stanley, Andrew Jeffery, David S . Miller, linux-arm-kernel,
	linux-aspeed, linux-kernel, linux-crypto, kernel test robot,
	Dan Carpenter

On Wed, Mar 01, 2023 at 11:32:05AM +0800, Neal Liu wrote:
> 'idx' is not initialized if it's not EXP_MODE nor MOD_MODE.
> Use "else" instead to fix it.
> 
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202302261052.CVFRyq6F-lkp@intel.com/
> 
> ---
>  drivers/crypto/aspeed/aspeed-acry.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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] 2+ messages in thread

end of thread, other threads:[~2023-03-10 11:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01  3:32 [PATCH] crypto: aspeed: fix uninitialized symbol 'idx' warning Neal Liu
2023-03-10 11:32 ` 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).