From: Zhou Wang <wangzhou1@hisilicon.com>
To: "Ondrej Mosnáček" <omosnacek@gmail.com>,
"Herbert Xu" <herbert@gondor.apana.org.au>
Cc: <linux-crypto@vger.kernel.org>
Subject: Re: crypto: hisilicon - Fix warning on printing %p with dma_addr_t
Date: Fri, 16 Aug 2019 15:53:39 +0800 [thread overview]
Message-ID: <5D566103.3000701@hisilicon.com> (raw)
In-Reply-To: <CAAUqJDuzUPUW=qvhEo6tU==Ycw0aijJM9pQk5W50kw=EgEG3ow@mail.gmail.com>
On 2019/8/16 15:08, Ondrej Mosnáček wrote:
> pi 16. 8. 2019 o 9:02 Ondrej Mosnáček <omosnacek@gmail.com> napísal(a):
>> Hi Herbert,
>>
>> pi 16. 8. 2019 o 1:52 Herbert Xu <herbert@gondor.apana.org.au> napísal(a):
>>> On Thu, Aug 15, 2019 at 10:17:37PM +0800, Zhou Wang wrote:
>>>>
>>>>> - 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-%#lxad\n",
>>>>> + queue, cmd, (unsigned long)dma_addr);
>>>>
>>>> Thanks. However, to be honest I can't get why we fix it like this.
>>>> Can you give me a clue?
>>>
>>> dma_addr_t is not a pointer. It's an integer type and therefore
>>> you need to print it out as such.
>>
>> According to Documentation/core-api/printk-formats.rst, %pad is the
>> format specifier intended specifically for dma_addr_t [1], so perhaps
>> the kbuild robot warning was in fact bogus?
>>
>> [1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#dma-address-types-dma-addr-t
>
> Oh, wait, in that section it actually says "Passed by reference.", so
> Zhou is most likely right that the proper fix is to pass a pointer to
> the variable containing the address (I assume this is to make the
> generic GCC's format checking pass even if dma_addr_t is not actually
> a pointer).
Yes, I think you are right, I also mentioned this in v3.
Thanks,
Zhou
>
>>
>>>
>>> Actually my patch is buggy too, on some architectures it can be
>>> a long long so we need to cast is such.
>>>
>>> Cheers,
>>> --
>>> 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
>
>
next prev parent reply other threads:[~2019-08-16 7:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 12:03 crypto: hisilicon - Fix warning on printing %p with dma_addr_t Herbert Xu
2019-08-15 14:17 ` Zhou Wang
2019-08-15 22:42 ` Herbert Xu
2019-08-16 7:02 ` Ondrej Mosnáček
2019-08-16 7:08 ` Ondrej Mosnáček
2019-08-16 7:53 ` Zhou Wang [this message]
2019-08-15 22:45 ` [v2 PATCH] " Herbert Xu
2019-08-15 22:47 ` [v3 " Herbert Xu
2019-08-16 6:04 ` Zhou Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5D566103.3000701@hisilicon.com \
--to=wangzhou1@hisilicon.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=omosnacek@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.