* [PATCH v2] crypto: aspeed: fix format unexpected build warning
@ 2022-09-05 5:24 Neal Liu
2022-09-05 14:22 ` Randy Dunlap
2022-09-07 2:13 ` Herbert Xu
0 siblings, 2 replies; 5+ messages in thread
From: Neal Liu @ 2022-09-05 5:24 UTC (permalink / raw)
To: Randy Dunlap, Herbert Xu, David S . Miller, Joel Stanley, Andrew Jeffery
Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel,
BMC-SW, kernel test robot
This fixes the following similar build warning when
enabling compile test:
aspeed-hace-hash.c:188:9: warning: format '%x' expects argument of type
'unsigned int', but argument 7 has type 'size_t' {aka 'long unsigned int'}
[-Wformat=]
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
---
v2: Use "%zu" format to print size_t.
drivers/crypto/aspeed/aspeed-hace-hash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/aspeed/aspeed-hace-hash.c b/drivers/crypto/aspeed/aspeed-hace-hash.c
index 0a44ffc0e13b..6e833d238253 100644
--- a/drivers/crypto/aspeed/aspeed-hace-hash.c
+++ b/drivers/crypto/aspeed/aspeed-hace-hash.c
@@ -185,7 +185,7 @@ static int aspeed_ahash_dma_prepare_sg(struct aspeed_hace_dev *hace_dev)
remain = (rctx->total + rctx->bufcnt) % rctx->block_size;
length = rctx->total + rctx->bufcnt - remain;
- AHASH_DBG(hace_dev, "%s:0x%x, %s:0x%x, %s:0x%x, %s:0x%x\n",
+ AHASH_DBG(hace_dev, "%s:0x%x, %s:%zu, %s:0x%x, %s:0x%x\n",
"rctx total", rctx->total, "bufcnt", rctx->bufcnt,
"length", length, "remain", remain);
@@ -324,7 +324,7 @@ static int aspeed_hace_ahash_trigger(struct aspeed_hace_dev *hace_dev,
struct ahash_request *req = hash_engine->req;
struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
- AHASH_DBG(hace_dev, "src_dma:0x%x, digest_dma:0x%x, length:0x%x\n",
+ AHASH_DBG(hace_dev, "src_dma:%zu, digest_dma:%zu, length:%zu\n",
hash_engine->src_dma, hash_engine->digest_dma,
hash_engine->src_length);
--
2.25.1
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH v2] crypto: aspeed: fix format unexpected build warning
2022-09-05 5:24 [PATCH v2] crypto: aspeed: fix format unexpected build warning Neal Liu
@ 2022-09-05 14:22 ` Randy Dunlap
2022-09-07 2:13 ` Herbert Xu
1 sibling, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2022-09-05 14:22 UTC (permalink / raw)
To: Neal Liu, Herbert Xu, David S . Miller, Joel Stanley, Andrew Jeffery
Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel,
BMC-SW, kernel test robot
On 9/4/22 22:24, Neal Liu wrote:
> This fixes the following similar build warning when
> enabling compile test:
>
> aspeed-hace-hash.c:188:9: warning: format '%x' expects argument of type
> 'unsigned int', but argument 7 has type 'size_t' {aka 'long unsigned int'}
> [-Wformat=]
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> v2: Use "%zu" format to print size_t.
>
> drivers/crypto/aspeed/aspeed-hace-hash.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/aspeed/aspeed-hace-hash.c b/drivers/crypto/aspeed/aspeed-hace-hash.c
> index 0a44ffc0e13b..6e833d238253 100644
> --- a/drivers/crypto/aspeed/aspeed-hace-hash.c
> +++ b/drivers/crypto/aspeed/aspeed-hace-hash.c
> @@ -185,7 +185,7 @@ static int aspeed_ahash_dma_prepare_sg(struct aspeed_hace_dev *hace_dev)
> remain = (rctx->total + rctx->bufcnt) % rctx->block_size;
> length = rctx->total + rctx->bufcnt - remain;
>
> - AHASH_DBG(hace_dev, "%s:0x%x, %s:0x%x, %s:0x%x, %s:0x%x\n",
> + AHASH_DBG(hace_dev, "%s:0x%x, %s:%zu, %s:0x%x, %s:0x%x\n",
> "rctx total", rctx->total, "bufcnt", rctx->bufcnt,
> "length", length, "remain", remain);
>
> @@ -324,7 +324,7 @@ static int aspeed_hace_ahash_trigger(struct aspeed_hace_dev *hace_dev,
> struct ahash_request *req = hash_engine->req;
> struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
>
> - AHASH_DBG(hace_dev, "src_dma:0x%x, digest_dma:0x%x, length:0x%x\n",
> + AHASH_DBG(hace_dev, "src_dma:%zu, digest_dma:%zu, length:%zu\n",
> hash_engine->src_dma, hash_engine->digest_dma,
> hash_engine->src_length);
>
--
~Randy
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH v2] crypto: aspeed: fix format unexpected build warning
2022-09-05 5:24 [PATCH v2] crypto: aspeed: fix format unexpected build warning Neal Liu
2022-09-05 14:22 ` Randy Dunlap
@ 2022-09-07 2:13 ` Herbert Xu
2022-09-07 3:02 ` Randy Dunlap
1 sibling, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2022-09-07 2:13 UTC (permalink / raw)
To: Neal Liu
Cc: Randy Dunlap, David S . Miller, Joel Stanley, Andrew Jeffery,
linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel,
BMC-SW, kernel test robot
On Mon, Sep 05, 2022 at 01:24:49PM +0800, Neal Liu wrote:
>
> @@ -324,7 +324,7 @@ static int aspeed_hace_ahash_trigger(struct aspeed_hace_dev *hace_dev,
> struct ahash_request *req = hash_engine->req;
> struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
>
> - AHASH_DBG(hace_dev, "src_dma:0x%x, digest_dma:0x%x, length:0x%x\n",
> + AHASH_DBG(hace_dev, "src_dma:%zu, digest_dma:%zu, length:%zu\n",
> hash_engine->src_dma, hash_engine->digest_dma,
> hash_engine->src_length);
Shouldn't we use %pad instead of %zu for dma_addr_t (you'll also
need to pass in a dma_addr_t pointer instead of the value)?
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
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH v2] crypto: aspeed: fix format unexpected build warning
2022-09-07 2:13 ` Herbert Xu
@ 2022-09-07 3:02 ` Randy Dunlap
2022-09-07 3:09 ` Neal Liu
0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2022-09-07 3:02 UTC (permalink / raw)
To: Herbert Xu, Neal Liu
Cc: David S . Miller, Joel Stanley, Andrew Jeffery, linux-aspeed,
linux-crypto, linux-arm-kernel, linux-kernel, BMC-SW,
kernel test robot
On 9/6/22 19:13, Herbert Xu wrote:
> On Mon, Sep 05, 2022 at 01:24:49PM +0800, Neal Liu wrote:
>>
>> @@ -324,7 +324,7 @@ static int aspeed_hace_ahash_trigger(struct aspeed_hace_dev *hace_dev,
>> struct ahash_request *req = hash_engine->req;
>> struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
>>
>> - AHASH_DBG(hace_dev, "src_dma:0x%x, digest_dma:0x%x, length:0x%x\n",
>> + AHASH_DBG(hace_dev, "src_dma:%zu, digest_dma:%zu, length:%zu\n",
>> hash_engine->src_dma, hash_engine->digest_dma,
>> hash_engine->src_length);
>
> Shouldn't we use %pad instead of %zu for dma_addr_t (you'll also
> need to pass in a dma_addr_t pointer instead of the value)?
That sounds correct.
I only looked at the size_t parts...
--
~Randy
_______________________________________________
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] 5+ messages in thread
* RE: [PATCH v2] crypto: aspeed: fix format unexpected build warning
2022-09-07 3:02 ` Randy Dunlap
@ 2022-09-07 3:09 ` Neal Liu
0 siblings, 0 replies; 5+ messages in thread
From: Neal Liu @ 2022-09-07 3:09 UTC (permalink / raw)
To: Randy Dunlap, Herbert Xu
Cc: David S . Miller, Joel Stanley, Andrew Jeffery, linux-aspeed,
linux-crypto, linux-arm-kernel, linux-kernel, BMC-SW,
kernel test robot
> On 9/6/22 19:13, Herbert Xu wrote:
> > On Mon, Sep 05, 2022 at 01:24:49PM +0800, Neal Liu wrote:
> >>
> >> @@ -324,7 +324,7 @@ static int aspeed_hace_ahash_trigger(struct
> aspeed_hace_dev *hace_dev,
> >> struct ahash_request *req = hash_engine->req;
> >> struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
> >>
> >> - AHASH_DBG(hace_dev, "src_dma:0x%x, digest_dma:0x%x,
> length:0x%x\n",
> >> + AHASH_DBG(hace_dev, "src_dma:%zu, digest_dma:%zu, length:%zu\n",
> >> hash_engine->src_dma, hash_engine->digest_dma,
> >> hash_engine->src_length);
> >
> > Shouldn't we use %pad instead of %zu for dma_addr_t (you'll also need
> > to pass in a dma_addr_t pointer instead of the value)?
>
> That sounds correct.
> I only looked at the size_t parts...
True. I'll revise it and send next patch, thanks.
_______________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2022-09-07 5:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 5:24 [PATCH v2] crypto: aspeed: fix format unexpected build warning Neal Liu
2022-09-05 14:22 ` Randy Dunlap
2022-09-07 2:13 ` Herbert Xu
2022-09-07 3:02 ` Randy Dunlap
2022-09-07 3:09 ` Neal Liu
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).