* [PATCH] spi: fix spi-atmel.c printk format warnings
@ 2014-03-21 15:53 Randy Dunlap
2014-03-21 16:02 ` Nicolas Ferre
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Randy Dunlap @ 2014-03-21 15:53 UTC (permalink / raw)
To: Mark Brown, LKML; +Cc: linux-spi, Wenyou Yang, Nicolas Ferre, Andrew Morton
From: Randy Dunlap <rdunlap@infradead.org>
Fix printk format warning by using %p extension 'ad' for dma_addr_t.
drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat]
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Wenyou Yang <wenyou.yang@atmel.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/spi/spi-atmel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
I thought that a patch for this was already posted but I can't find it...
Applies to mainline.
--- linux-next-20140321.orig/drivers/spi/spi-atmel.c
+++ linux-next-20140321/drivers/spi/spi-atmel.c
@@ -1226,10 +1226,10 @@ static int atmel_spi_transfer_one_messag
list_for_each_entry(xfer, &msg->transfers, transfer_list) {
dev_dbg(&spi->dev,
- " xfer %p: len %u tx %p/%08x rx %p/%08x\n",
+ " xfer %p: len %u tx %p/%pad rx %p/%pad\n",
xfer, xfer->len,
- xfer->tx_buf, xfer->tx_dma,
- xfer->rx_buf, xfer->rx_dma);
+ xfer->tx_buf, &xfer->tx_dma,
+ xfer->rx_buf, &xfer->rx_dma);
}
msg_done:
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] spi: fix spi-atmel.c printk format warnings
@ 2014-03-21 16:02 ` Nicolas Ferre
0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Ferre @ 2014-03-21 16:02 UTC (permalink / raw)
To: Randy Dunlap, Mark Brown, LKML; +Cc: linux-spi, Wenyou Yang, Andrew Morton
On 21/03/2014 16:53, Randy Dunlap :
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
>
> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat]
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Wenyou Yang <wenyou.yang@atmel.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/spi/spi-atmel.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> I thought that a patch for this was already posted but I can't find it...
> Applies to mainline.
>
> --- linux-next-20140321.orig/drivers/spi/spi-atmel.c
> +++ linux-next-20140321/drivers/spi/spi-atmel.c
> @@ -1226,10 +1226,10 @@ static int atmel_spi_transfer_one_messag
>
> list_for_each_entry(xfer, &msg->transfers, transfer_list) {
> dev_dbg(&spi->dev,
> - " xfer %p: len %u tx %p/%08x rx %p/%08x\n",
> + " xfer %p: len %u tx %p/%pad rx %p/%pad\n",
> xfer, xfer->len,
> - xfer->tx_buf, xfer->tx_dma,
> - xfer->rx_buf, xfer->rx_dma);
> + xfer->tx_buf, &xfer->tx_dma,
> + xfer->rx_buf, &xfer->rx_dma);
> }
>
> msg_done:
>
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] spi: fix spi-atmel.c printk format warnings
@ 2014-03-21 16:02 ` Nicolas Ferre
0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Ferre @ 2014-03-21 16:02 UTC (permalink / raw)
To: Randy Dunlap, Mark Brown, LKML
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Wenyou Yang, Andrew Morton
On 21/03/2014 16:53, Randy Dunlap :
> From: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
>
> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
>
> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat]
>
> Signed-off-by: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> Cc: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
> Cc: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Acked-by: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/spi/spi-atmel.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> I thought that a patch for this was already posted but I can't find it...
> Applies to mainline.
>
> --- linux-next-20140321.orig/drivers/spi/spi-atmel.c
> +++ linux-next-20140321/drivers/spi/spi-atmel.c
> @@ -1226,10 +1226,10 @@ static int atmel_spi_transfer_one_messag
>
> list_for_each_entry(xfer, &msg->transfers, transfer_list) {
> dev_dbg(&spi->dev,
> - " xfer %p: len %u tx %p/%08x rx %p/%08x\n",
> + " xfer %p: len %u tx %p/%pad rx %p/%pad\n",
> xfer, xfer->len,
> - xfer->tx_buf, xfer->tx_dma,
> - xfer->rx_buf, xfer->rx_dma);
> + xfer->tx_buf, &xfer->tx_dma,
> + xfer->rx_buf, &xfer->rx_dma);
> }
>
> msg_done:
>
>
--
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* rfc: vsprintf and phys_addr_t and dma_addr_t via %pa (was Re: [PATCH] spi: fix spi-atmel.c printk format warnings)
2014-03-21 15:53 [PATCH] spi: fix spi-atmel.c printk format warnings Randy Dunlap
2014-03-21 16:02 ` Nicolas Ferre
@ 2014-03-21 16:37 ` Joe Perches
2014-03-21 16:42 ` Randy Dunlap
2014-03-21 17:45 ` Mark Brown
2 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2014-03-21 16:37 UTC (permalink / raw)
To: Randy Dunlap, Stepan Moskovchenko
Cc: Mark Brown, LKML, linux-spi, Wenyou Yang, Nicolas Ferre, Andrew Morton
(Adding Stepan Moskovchenko who added %pa to vsprintf)
On Fri, 2014-03-21 at 08:53 -0700, Randy Dunlap wrote:
> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
Hey Randy, Stepan and everyone else as well.
One of the things I'd like to get straightened out
before too many of these dma_addr_t conversions are
done is whether or not it should be prefixed by 0x.
%pad is not a direct replacement for %08x or %016x.
It changes the output.
Right now, all phys_addr_t and dma_addr_t types emitted
using %pa[pd] are "SPECIAL", meaning these are prefixed
with "0x".
No other pointer/address types have that "0x" prefix.
I'd prefer to remove the "SPECIAL" from the %pa extension
so that the output form of pointer/address types are
consistent.
This would change several output lines already using %pa.
I don't think that's bad, but maybe others do.
Thoughts?
---
lib/vsprintf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 185b6d3..28fee91 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1161,18 +1161,18 @@ char *address_val(char *buf, char *end, const void *addr,
{
unsigned long long num;
- spec.flags |= SPECIAL | SMALL | ZEROPAD;
+ spec.flags |= SMALL | ZEROPAD;
spec.base = 16;
switch (fmt[1]) {
case 'd':
num = *(const dma_addr_t *)addr;
- spec.field_width = sizeof(dma_addr_t) * 2 + 2;
+ spec.field_width = sizeof(dma_addr_t) * 2;
break;
case 'p':
default:
num = *(const phys_addr_t *)addr;
- spec.field_width = sizeof(phys_addr_t) * 2 + 2;
+ spec.field_width = sizeof(phys_addr_t) * 2;
break;
}
> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat]
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Wenyou Yang <wenyou.yang@atmel.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/spi/spi-atmel.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> I thought that a patch for this was already posted but I can't find it...
> Applies to mainline.
>
> --- linux-next-20140321.orig/drivers/spi/spi-atmel.c
> +++ linux-next-20140321/drivers/spi/spi-atmel.c
> @@ -1226,10 +1226,10 @@ static int atmel_spi_transfer_one_messag
>
> list_for_each_entry(xfer, &msg->transfers, transfer_list) {
> dev_dbg(&spi->dev,
> - " xfer %p: len %u tx %p/%08x rx %p/%08x\n",
> + " xfer %p: len %u tx %p/%pad rx %p/%pad\n",
> xfer, xfer->len,
> - xfer->tx_buf, xfer->tx_dma,
> - xfer->rx_buf, xfer->rx_dma);
> + xfer->tx_buf, &xfer->tx_dma,
> + xfer->rx_buf, &xfer->rx_dma);
> }
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: rfc: vsprintf and phys_addr_t and dma_addr_t via %pa (was Re: [PATCH] spi: fix spi-atmel.c printk format warnings)
2014-03-21 16:37 ` rfc: vsprintf and phys_addr_t and dma_addr_t via %pa (was Re: [PATCH] spi: fix spi-atmel.c printk format warnings) Joe Perches
@ 2014-03-21 16:42 ` Randy Dunlap
0 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2014-03-21 16:42 UTC (permalink / raw)
To: Joe Perches, Stepan Moskovchenko
Cc: Mark Brown, LKML, linux-spi, Wenyou Yang, Nicolas Ferre, Andrew Morton
On 03/21/2014 09:37 AM, Joe Perches wrote:
> (Adding Stepan Moskovchenko who added %pa to vsprintf)
>
> On Fri, 2014-03-21 at 08:53 -0700, Randy Dunlap wrote:
>> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
>
> Hey Randy, Stepan and everyone else as well.
>
> One of the things I'd like to get straightened out
> before too many of these dma_addr_t conversions are
> done is whether or not it should be prefixed by 0x.
>
> %pad is not a direct replacement for %08x or %016x.
> It changes the output.
>
> Right now, all phys_addr_t and dma_addr_t types emitted
> using %pa[pd] are "SPECIAL", meaning these are prefixed
> with "0x".
>
> No other pointer/address types have that "0x" prefix.
>
> I'd prefer to remove the "SPECIAL" from the %pa extension
> so that the output form of pointer/address types are
> consistent.
I agree.
for Joe's patch:
Acked-by: Randy Dunlap <rdunlap@infradead.org>
> This would change several output lines already using %pa.
>
> I don't think that's bad, but maybe others do.
>
> Thoughts?
>
> ---
> lib/vsprintf.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 185b6d3..28fee91 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -1161,18 +1161,18 @@ char *address_val(char *buf, char *end, const void *addr,
> {
> unsigned long long num;
>
> - spec.flags |= SPECIAL | SMALL | ZEROPAD;
> + spec.flags |= SMALL | ZEROPAD;
> spec.base = 16;
>
> switch (fmt[1]) {
> case 'd':
> num = *(const dma_addr_t *)addr;
> - spec.field_width = sizeof(dma_addr_t) * 2 + 2;
> + spec.field_width = sizeof(dma_addr_t) * 2;
> break;
> case 'p':
> default:
> num = *(const phys_addr_t *)addr;
> - spec.field_width = sizeof(phys_addr_t) * 2 + 2;
> + spec.field_width = sizeof(phys_addr_t) * 2;
> break;
> }
>
>
>
>> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
>> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat]
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Wenyou Yang <wenyou.yang@atmel.com>
>> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>> drivers/spi/spi-atmel.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> I thought that a patch for this was already posted but I can't find it...
>> Applies to mainline.
>>
>> --- linux-next-20140321.orig/drivers/spi/spi-atmel.c
>> +++ linux-next-20140321/drivers/spi/spi-atmel.c
>> @@ -1226,10 +1226,10 @@ static int atmel_spi_transfer_one_messag
>>
>> list_for_each_entry(xfer, &msg->transfers, transfer_list) {
>> dev_dbg(&spi->dev,
>> - " xfer %p: len %u tx %p/%08x rx %p/%08x\n",
>> + " xfer %p: len %u tx %p/%pad rx %p/%pad\n",
>> xfer, xfer->len,
>> - xfer->tx_buf, xfer->tx_dma,
>> - xfer->rx_buf, xfer->rx_dma);
>> + xfer->tx_buf, &xfer->tx_dma,
>> + xfer->rx_buf, &xfer->rx_dma);
>> }
>
>
> --
--
~Randy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: rfc: vsprintf and phys_addr_t and dma_addr_t via %pa (was Re: [PATCH] spi: fix spi-atmel.c printk format warnings)
@ 2014-03-21 16:42 ` Randy Dunlap
0 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2014-03-21 16:42 UTC (permalink / raw)
To: Joe Perches, Stepan Moskovchenko
Cc: Mark Brown, LKML, linux-spi-u79uwXL29TY76Z2rM5mHXA, Wenyou Yang,
Nicolas Ferre, Andrew Morton
On 03/21/2014 09:37 AM, Joe Perches wrote:
> (Adding Stepan Moskovchenko who added %pa to vsprintf)
>
> On Fri, 2014-03-21 at 08:53 -0700, Randy Dunlap wrote:
>> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
>
> Hey Randy, Stepan and everyone else as well.
>
> One of the things I'd like to get straightened out
> before too many of these dma_addr_t conversions are
> done is whether or not it should be prefixed by 0x.
>
> %pad is not a direct replacement for %08x or %016x.
> It changes the output.
>
> Right now, all phys_addr_t and dma_addr_t types emitted
> using %pa[pd] are "SPECIAL", meaning these are prefixed
> with "0x".
>
> No other pointer/address types have that "0x" prefix.
>
> I'd prefer to remove the "SPECIAL" from the %pa extension
> so that the output form of pointer/address types are
> consistent.
I agree.
for Joe's patch:
Acked-by: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> This would change several output lines already using %pa.
>
> I don't think that's bad, but maybe others do.
>
> Thoughts?
>
> ---
> lib/vsprintf.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 185b6d3..28fee91 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -1161,18 +1161,18 @@ char *address_val(char *buf, char *end, const void *addr,
> {
> unsigned long long num;
>
> - spec.flags |= SPECIAL | SMALL | ZEROPAD;
> + spec.flags |= SMALL | ZEROPAD;
> spec.base = 16;
>
> switch (fmt[1]) {
> case 'd':
> num = *(const dma_addr_t *)addr;
> - spec.field_width = sizeof(dma_addr_t) * 2 + 2;
> + spec.field_width = sizeof(dma_addr_t) * 2;
> break;
> case 'p':
> default:
> num = *(const phys_addr_t *)addr;
> - spec.field_width = sizeof(phys_addr_t) * 2 + 2;
> + spec.field_width = sizeof(phys_addr_t) * 2;
> break;
> }
>
>
>
>> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
>> drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat]
>>
>> Signed-off-by: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
>> Cc: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
>> Cc: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/spi/spi-atmel.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> I thought that a patch for this was already posted but I can't find it...
>> Applies to mainline.
>>
>> --- linux-next-20140321.orig/drivers/spi/spi-atmel.c
>> +++ linux-next-20140321/drivers/spi/spi-atmel.c
>> @@ -1226,10 +1226,10 @@ static int atmel_spi_transfer_one_messag
>>
>> list_for_each_entry(xfer, &msg->transfers, transfer_list) {
>> dev_dbg(&spi->dev,
>> - " xfer %p: len %u tx %p/%08x rx %p/%08x\n",
>> + " xfer %p: len %u tx %p/%pad rx %p/%pad\n",
>> xfer, xfer->len,
>> - xfer->tx_buf, xfer->tx_dma,
>> - xfer->rx_buf, xfer->rx_dma);
>> + xfer->tx_buf, &xfer->tx_dma,
>> + xfer->rx_buf, &xfer->rx_dma);
>> }
>
>
> --
--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] spi: fix spi-atmel.c printk format warnings
@ 2014-03-21 17:45 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-03-21 17:45 UTC (permalink / raw)
To: Randy Dunlap; +Cc: LKML, linux-spi, Wenyou Yang, Nicolas Ferre, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
On Fri, Mar 21, 2014 at 08:53:41AM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
Applied, thanks. Please try to use subject lines matching the style for
the subsystem.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] spi: fix spi-atmel.c printk format warnings
@ 2014-03-21 17:45 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-03-21 17:45 UTC (permalink / raw)
To: Randy Dunlap
Cc: LKML, linux-spi-u79uwXL29TY76Z2rM5mHXA, Wenyou Yang,
Nicolas Ferre, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 303 bytes --]
On Fri, Mar 21, 2014 at 08:53:41AM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
>
> Fix printk format warning by using %p extension 'ad' for dma_addr_t.
Applied, thanks. Please try to use subject lines matching the style for
the subsystem.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-03-21 17:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 15:53 [PATCH] spi: fix spi-atmel.c printk format warnings Randy Dunlap
2014-03-21 16:02 ` Nicolas Ferre
2014-03-21 16:02 ` Nicolas Ferre
2014-03-21 16:37 ` rfc: vsprintf and phys_addr_t and dma_addr_t via %pa (was Re: [PATCH] spi: fix spi-atmel.c printk format warnings) Joe Perches
2014-03-21 16:42 ` Randy Dunlap
2014-03-21 16:42 ` Randy Dunlap
2014-03-21 17:45 ` [PATCH] spi: fix spi-atmel.c printk format warnings Mark Brown
2014-03-21 17:45 ` Mark Brown
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.