2019-08-15 23:51:46

by Herbert Xu

[permalink] [raw]
Subject: [v3 PATCH] crypto: hisilicon - Fix warning on printing %p with dma_addr_t

This patch fixes a printk format warning by replacing %p with %#llx
for dma_addr_t.

Signed-off-by: Herbert Xu <[email protected]>

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index d72e062..4ad4de4 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -347,8 +353,8 @@ static int qm_mb(struct hisi_qm *qm, u8 cmd, dma_addr_t dma_addr, u16 queue,
struct qm_mailbox mailbox;
int ret = 0;

- dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%pad\n", queue,
- cmd, dma_addr);
+ dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%llx\n",
+ queue, cmd, (unsigned long long)dma_addr);

mailbox.w0 = cmd |
(op ? 0x1 << QM_MB_OP_SHIFT : 0) |
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


2019-08-16 06:04:50

by Zhou Wang

[permalink] [raw]
Subject: Re: [v3 PATCH] crypto: hisilicon - Fix warning on printing %p with dma_addr_t

On 2019/8/16 6:47, Herbert Xu wrote:
> This patch fixes a printk format warning by replacing %p with %#llx
> for dma_addr_t.
>
> Signed-off-by: Herbert Xu <[email protected]>
>
> diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
> index d72e062..4ad4de4 100644
> --- a/drivers/crypto/hisilicon/qm.c
> +++ b/drivers/crypto/hisilicon/qm.c
> @@ -347,8 +353,8 @@ static int qm_mb(struct hisi_qm *qm, u8 cmd, dma_addr_t dma_addr, u16 queue,
> struct qm_mailbox mailbox;
> int ret = 0;
>
> - dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%pad\n", queue,
> - cmd, dma_addr);
> + dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%llx\n",
> + queue, cmd, (unsigned long long)dma_addr);

I should modify this as:

dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%pad\n",
queue, cmd, &dma_addr);

>
> mailbox.w0 = cmd |
> (op ? 0x1 << QM_MB_OP_SHIFT : 0) |
>