All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: testmgr - Fix format argument warning
@ 2020-10-10  2:16 ` Ye Bin
  0 siblings, 0 replies; 4+ messages in thread
From: Ye Bin @ 2020-10-10  2:16 UTC (permalink / raw)
  To: herbert, davem, mcoquelin.stm32, alexandre.torgue, linux-crypto,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Ye Bin

Fix follow warning:
[crypto/testmgr.c:2317]: (warning) %d in format string (no. 5) requires
'int' but the argument type is 'unsigned int'.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 crypto/testmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index a64a639eddfa..aefa4b6b8d78 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2315,7 +2315,7 @@ static void generate_random_aead_testvec(struct aead_request *req,
 	if (vec->setkey_error == 0 && vec->setauthsize_error == 0)
 		generate_aead_message(req, suite, vec, prefer_inauthentic);
 	snprintf(name, max_namelen,
-		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%d\"",
+		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%u\"",
 		 vec->alen, vec->plen, authsize, vec->klen, vec->novrfy);
 }
 
-- 
2.16.2.dirty


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

* [PATCH] crypto: testmgr - Fix format argument warning
@ 2020-10-10  2:16 ` Ye Bin
  0 siblings, 0 replies; 4+ messages in thread
From: Ye Bin @ 2020-10-10  2:16 UTC (permalink / raw)
  To: herbert, davem, mcoquelin.stm32, alexandre.torgue, linux-crypto,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Ye Bin

Fix follow warning:
[crypto/testmgr.c:2317]: (warning) %d in format string (no. 5) requires
'int' but the argument type is 'unsigned int'.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 crypto/testmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index a64a639eddfa..aefa4b6b8d78 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2315,7 +2315,7 @@ static void generate_random_aead_testvec(struct aead_request *req,
 	if (vec->setkey_error == 0 && vec->setauthsize_error == 0)
 		generate_aead_message(req, suite, vec, prefer_inauthentic);
 	snprintf(name, max_namelen,
-		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%d\"",
+		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%u\"",
 		 vec->alen, vec->plen, authsize, vec->klen, vec->novrfy);
 }
 
-- 
2.16.2.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] crypto: testmgr - Fix format argument warning
  2020-10-10  2:16 ` Ye Bin
@ 2020-10-10 18:32   ` Eric Biggers
  -1 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2020-10-10 18:32 UTC (permalink / raw)
  To: Ye Bin
  Cc: herbert, davem, mcoquelin.stm32, alexandre.torgue, linux-crypto,
	linux-stm32, linux-arm-kernel, linux-kernel

On Sat, Oct 10, 2020 at 10:16:37AM +0800, Ye Bin wrote:
> Fix follow warning:
> [crypto/testmgr.c:2317]: (warning) %d in format string (no. 5) requires
> 'int' but the argument type is 'unsigned int'.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
>  crypto/testmgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index a64a639eddfa..aefa4b6b8d78 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -2315,7 +2315,7 @@ static void generate_random_aead_testvec(struct aead_request *req,
>  	if (vec->setkey_error == 0 && vec->setauthsize_error == 0)
>  		generate_aead_message(req, suite, vec, prefer_inauthentic);
>  	snprintf(name, max_namelen,
> -		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%d\"",
> +		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%u\"",
>  		 vec->alen, vec->plen, authsize, vec->klen, vec->novrfy);

Actually vec->novrfy is 'unsigned char', not 'unsigned int'.  Both %u and %d
will work, but %d is technically correct because 'unsigned char' gets promoted
to 'int'.  What tool are you using that claims this is wrong?

- Eric

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

* Re: [PATCH] crypto: testmgr - Fix format argument warning
@ 2020-10-10 18:32   ` Eric Biggers
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2020-10-10 18:32 UTC (permalink / raw)
  To: Ye Bin
  Cc: alexandre.torgue, linux-kernel, davem, linux-crypto,
	mcoquelin.stm32, linux-stm32, linux-arm-kernel, herbert

On Sat, Oct 10, 2020 at 10:16:37AM +0800, Ye Bin wrote:
> Fix follow warning:
> [crypto/testmgr.c:2317]: (warning) %d in format string (no. 5) requires
> 'int' but the argument type is 'unsigned int'.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
>  crypto/testmgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index a64a639eddfa..aefa4b6b8d78 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -2315,7 +2315,7 @@ static void generate_random_aead_testvec(struct aead_request *req,
>  	if (vec->setkey_error == 0 && vec->setauthsize_error == 0)
>  		generate_aead_message(req, suite, vec, prefer_inauthentic);
>  	snprintf(name, max_namelen,
> -		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%d\"",
> +		 "\"random: alen=%u plen=%u authsize=%u klen=%u novrfy=%u\"",
>  		 vec->alen, vec->plen, authsize, vec->klen, vec->novrfy);

Actually vec->novrfy is 'unsigned char', not 'unsigned int'.  Both %u and %d
will work, but %d is technically correct because 'unsigned char' gets promoted
to 'int'.  What tool are you using that claims this is wrong?

- Eric

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-10-10 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10  2:16 [PATCH] crypto: testmgr - Fix format argument warning Ye Bin
2020-10-10  2:16 ` Ye Bin
2020-10-10 18:32 ` Eric Biggers
2020-10-10 18:32   ` Eric Biggers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.