linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: sa2ul - Fix pointer-to-int-cast warning
@ 2020-08-18 14:00 YueHaibing
  2020-08-28  7:19 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-08-18 14:00 UTC (permalink / raw)
  To: herbert, davem, j-keerthy; +Cc: linux-crypto, linux-kernel, YueHaibing

drivers/crypto/sa2ul.c: In function ‘sa_sha_init’:
drivers/crypto/sa2ul.c:1486:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   crypto_ahash_digestsize(tfm), (u64)rctx);
                                 ^
./include/linux/dev_printk.h:123:47: note: in definition of macro ‘dev_dbg’
   dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
                                               ^~~~~~~~~~~

Use %p to print rctx pointer.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/sa2ul.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 5bc099052bd2..acabb8ddacb6 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -1482,8 +1482,8 @@ static int sa_sha_init(struct ahash_request *req)
 	struct sa_sha_req_ctx *rctx = ahash_request_ctx(req);
 	struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
 
-	dev_dbg(sa_k3_dev, "init: digest size: %d, rctx=%llx\n",
-		crypto_ahash_digestsize(tfm), (u64)rctx);
+	dev_dbg(sa_k3_dev, "init: digest size: %u, rctx=%p\n",
+		crypto_ahash_digestsize(tfm), rctx);
 
 	ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback.ahash);
 	rctx->fallback_req.base.flags =
-- 
2.17.1



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

* Re: [PATCH -next] crypto: sa2ul - Fix pointer-to-int-cast warning
  2020-08-18 14:00 [PATCH -next] crypto: sa2ul - Fix pointer-to-int-cast warning YueHaibing
@ 2020-08-28  7:19 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2020-08-28  7:19 UTC (permalink / raw)
  To: YueHaibing; +Cc: davem, j-keerthy, linux-crypto, linux-kernel

On Tue, Aug 18, 2020 at 10:00:01PM +0800, YueHaibing wrote:
> drivers/crypto/sa2ul.c: In function ‘sa_sha_init’:
> drivers/crypto/sa2ul.c:1486:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>    crypto_ahash_digestsize(tfm), (u64)rctx);
>                                  ^
> ./include/linux/dev_printk.h:123:47: note: in definition of macro ‘dev_dbg’
>    dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
>                                                ^~~~~~~~~~~
> 
> Use %p to print rctx pointer.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/sa2ul.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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:[~2020-08-28  7:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 14:00 [PATCH -next] crypto: sa2ul - Fix pointer-to-int-cast warning YueHaibing
2020-08-28  7:19 ` 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).