linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: omap: fix trivial warnings for dspbridge
@ 2012-04-20 22:04 Felipe Contreras
  2012-04-20 23:34 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Contreras @ 2012-04-20 22:04 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Russell King, Jiri Kosina, linux-arm-kernel, Felipe Contreras

arch/arm/plat-omap/devices.c: In function 'omap_dsp_reserve_sdram_memblock':
arch/arm/plat-omap/devices.c:170: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'phys_addr_t'
arch/arm/mach-omap2/dsp.c: In function 'omap_dsp_init':
arch/arm/mach-omap2/dsp.c:60: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'phys_addr_t'
arch/arm/mach-omap2/dsp.c:60: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'phys_addr_t'

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 arch/arm/mach-omap2/dsp.c    |    5 +++--
 arch/arm/plat-omap/devices.c |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index 74f18f2..7665c49 100644
--- a/arch/arm/mach-omap2/dsp.c
+++ b/arch/arm/mach-omap2/dsp.c
@@ -57,8 +57,9 @@ static int __init omap_dsp_init(void)
 
 	if (pdata->phys_mempool_base) {
 		pdata->phys_mempool_size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
-		pr_info("%s: %x bytes @ %x\n", __func__,
-			pdata->phys_mempool_size, pdata->phys_mempool_base);
+		pr_info("%s: %llu bytes @ %llu\n", __func__,
+			(unsigned long long)pdata->phys_mempool_size,
+			(unsigned long long)pdata->phys_mempool_base);
 	}
 
 	pdev = platform_device_alloc("omap-dsp", -1);
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 60278f4..ffccec7 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -167,8 +167,8 @@ void __init omap_dsp_reserve_sdram_memblock(void)
 
 	paddr = arm_memblock_steal(size, SZ_1M);
 	if (!paddr) {
-		pr_err("%s: failed to reserve %x bytes\n",
-				__func__, size);
+		pr_err("%s: failed to reserve %llu bytes\n",
+				__func__, (unsigned long long)size);
 		return;
 	}
 
-- 
1.7.10


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

* Re: [PATCH] arm: omap: fix trivial warnings for dspbridge
  2012-04-20 22:04 [PATCH] arm: omap: fix trivial warnings for dspbridge Felipe Contreras
@ 2012-04-20 23:34 ` Russell King - ARM Linux
  2012-04-20 23:42   ` Felipe Contreras
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-04-20 23:34 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Tony Lindgren, linux-omap, Jiri Kosina, linux-arm-kernel

On Sat, Apr 21, 2012 at 01:04:18AM +0300, Felipe Contreras wrote:
> arch/arm/plat-omap/devices.c: In function 'omap_dsp_reserve_sdram_memblock':
> arch/arm/plat-omap/devices.c:170: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'phys_addr_t'
> arch/arm/mach-omap2/dsp.c: In function 'omap_dsp_init':
> arch/arm/mach-omap2/dsp.c:60: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'phys_addr_t'
> arch/arm/mach-omap2/dsp.c:60: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'phys_addr_t'
> 
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  arch/arm/mach-omap2/dsp.c    |    5 +++--
>  arch/arm/plat-omap/devices.c |    4 ++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
> index 74f18f2..7665c49 100644
> --- a/arch/arm/mach-omap2/dsp.c
> +++ b/arch/arm/mach-omap2/dsp.c
> @@ -57,8 +57,9 @@ static int __init omap_dsp_init(void)
>  
>  	if (pdata->phys_mempool_base) {
>  		pdata->phys_mempool_size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
> -		pr_info("%s: %x bytes @ %x\n", __func__,
> -			pdata->phys_mempool_size, pdata->phys_mempool_base);
> +		pr_info("%s: %llu bytes @ %llu\n", __func__,

No, don't change a unprefixed hex number to a decimal number.  Keep
the same formatting, just fix the warning.  Changing the base of the
displayed number when there's no hex prefix to it is just plain idiotic
and creates confusion.  Think: is the number 12345678 output by one of
these a hex number or a decimal number?

Besides, base addresses _should_ be hex numbers.  I'd agree that sizes
should probably be decimal, but as none of these locations you're fixing
had 0x prefixes, I'd strongly advise to leave them as-is - esp. for a
patch allegedly just fixing warnings.

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

* Re: [PATCH] arm: omap: fix trivial warnings for dspbridge
  2012-04-20 23:34 ` Russell King - ARM Linux
@ 2012-04-20 23:42   ` Felipe Contreras
  0 siblings, 0 replies; 3+ messages in thread
From: Felipe Contreras @ 2012-04-20 23:42 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-omap, Jiri Kosina, linux-arm-kernel

On Sat, Apr 21, 2012 at 2:34 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

>> --- a/arch/arm/mach-omap2/dsp.c
>> +++ b/arch/arm/mach-omap2/dsp.c
>> @@ -57,8 +57,9 @@ static int __init omap_dsp_init(void)
>>
>>       if (pdata->phys_mempool_base) {
>>               pdata->phys_mempool_size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
>> -             pr_info("%s: %x bytes @ %x\n", __func__,
>> -                     pdata->phys_mempool_size, pdata->phys_mempool_base);
>> +             pr_info("%s: %llu bytes @ %llu\n", __func__,
>
> No, don't change a unprefixed hex number to a decimal number.  Keep
> the same formatting, just fix the warning.  Changing the base of the
> displayed number when there's no hex prefix to it is just plain idiotic
> and creates confusion.  Think: is the number 12345678 output by one of
> these a hex number or a decimal number?
>
> Besides, base addresses _should_ be hex numbers.  I'd agree that sizes
> should probably be decimal, but as none of these locations you're fixing
> had 0x prefixes, I'd strongly advise to leave them as-is - esp. for a
> patch allegedly just fixing warnings.

Right, I was too fast copying what Documentation/printk-formats.txt
suggested (%llu). So s/%llu/%llx/? I prefer to keep the size also as
hex, as it's usually how it's configured.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-04-20 23:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-20 22:04 [PATCH] arm: omap: fix trivial warnings for dspbridge Felipe Contreras
2012-04-20 23:34 ` Russell King - ARM Linux
2012-04-20 23:42   ` Felipe Contreras

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).