* [PATCH] powerpc/85xx: Fix compile warnings in mpc85xx_mds.c
@ 2008-12-03 15:38 Kumar Gala
2008-12-03 16:17 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2008-12-03 15:38 UTC (permalink / raw)
To: linuxppc-dev
arch/powerpc/platforms/85xx/mpc85xx_mds.c: In function 'board_fixups':
arch/powerpc/platforms/85xx/mpc85xx_mds.c:244: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'
arch/powerpc/platforms/85xx/mpc85xx_mds.c:250: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 2494c51..915e8d3 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -241,13 +241,13 @@ static int __init board_fixups(void)
mdio = of_find_compatible_node(NULL, NULL, compstrs[i]);
of_address_to_resource(mdio, 0, &res);
- snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 1);
+ snprintf(phy_id, BUS_ID_SIZE, "%llx:%02x", (u64)res.start, 1);
phy_register_fixup_for_id(phy_id, mpc8568_fixup_125_clock);
phy_register_fixup_for_id(phy_id, mpc8568_mds_phy_fixups);
/* Register a workaround for errata */
- snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 7);
+ snprintf(phy_id, BUS_ID_SIZE, "%llx:%02x", (u64)res.start, 7);
phy_register_fixup_for_id(phy_id, mpc8568_mds_phy_fixups);
of_node_put(mdio);
--
1.5.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/85xx: Fix compile warnings in mpc85xx_mds.c
2008-12-03 15:38 [PATCH] powerpc/85xx: Fix compile warnings in mpc85xx_mds.c Kumar Gala
@ 2008-12-03 16:17 ` Geert Uytterhoeven
2008-12-03 16:21 ` Kumar Gala
0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-12-03 16:17 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
On Wed, 3 Dec 2008, Kumar Gala wrote:
> arch/powerpc/platforms/85xx/mpc85xx_mds.c: In function 'board_fixups':
> arch/powerpc/platforms/85xx/mpc85xx_mds.c:244: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'
> arch/powerpc/platforms/85xx/mpc85xx_mds.c:250: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/platforms/85xx/mpc85xx_mds.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> index 2494c51..915e8d3 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> @@ -241,13 +241,13 @@ static int __init board_fixups(void)
> mdio = of_find_compatible_node(NULL, NULL, compstrs[i]);
>
> of_address_to_resource(mdio, 0, &res);
> - snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 1);
> + snprintf(phy_id, BUS_ID_SIZE, "%llx:%02x", (u64)res.start, 1);
^^^
unsigned long? u64 differs for 32-bit and 64-bit.
Doh, if you would put the whole resource range there, you could use %pR ;-)
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/85xx: Fix compile warnings in mpc85xx_mds.c
2008-12-03 16:17 ` Geert Uytterhoeven
@ 2008-12-03 16:21 ` Kumar Gala
2008-12-03 16:43 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2008-12-03 16:21 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev
On Dec 3, 2008, at 10:17 AM, Geert Uytterhoeven wrote:
> On Wed, 3 Dec 2008, Kumar Gala wrote:
>> arch/powerpc/platforms/85xx/mpc85xx_mds.c: In function
>> 'board_fixups':
>> arch/powerpc/platforms/85xx/mpc85xx_mds.c:244: warning: format '%x'
>> expects type 'unsigned int', but argument 4 has type
>> 'resource_size_t'
>> arch/powerpc/platforms/85xx/mpc85xx_mds.c:250: warning: format '%x'
>> expects type 'unsigned int', but argument 4 has type
>> 'resource_size_t'
>>
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_mds.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/
>> powerpc/platforms/85xx/mpc85xx_mds.c
>> index 2494c51..915e8d3 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
>> @@ -241,13 +241,13 @@ static int __init board_fixups(void)
>> mdio = of_find_compatible_node(NULL, NULL, compstrs[i]);
>>
>> of_address_to_resource(mdio, 0, &res);
>> - snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 1);
>> + snprintf(phy_id, BUS_ID_SIZE, "%llx:%02x", (u64)res.start, 1);
> ^^^
> unsigned long? u64 differs for 32-bit and 64-bit.
This is proper. This is a 32-bit only platform (and the format is
long long).
> Doh, if you would put the whole resource range there, you could use
> %pR ;-)
and if we had a %R ... :)
- k
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/85xx: Fix compile warnings in mpc85xx_mds.c
2008-12-03 16:21 ` Kumar Gala
@ 2008-12-03 16:43 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-12-03 16:43 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
On Wed, 3 Dec 2008, Kumar Gala wrote:
> On Dec 3, 2008, at 10:17 AM, Geert Uytterhoeven wrote:
> >On Wed, 3 Dec 2008, Kumar Gala wrote:
> > >arch/powerpc/platforms/85xx/mpc85xx_mds.c: In function 'board_fixups':
> > >arch/powerpc/platforms/85xx/mpc85xx_mds.c:244: warning: format '%x' expects
> > >type 'unsigned int', but argument 4 has type 'resource_size_t'
> > >arch/powerpc/platforms/85xx/mpc85xx_mds.c:250: warning: format '%x' expects
> > >type 'unsigned int', but argument 4 has type 'resource_size_t'
> > >
> > >Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> > >---
> > >arch/powerpc/platforms/85xx/mpc85xx_mds.c | 4 ++--
> > >1 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > >diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> > >b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> > >index 2494c51..915e8d3 100644
> > >--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> > >+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> >>@@ -241,13 +241,13 @@ static int __init board_fixups(void)
> > > mdio = of_find_compatible_node(NULL, NULL, compstrs[i]);
> > >
> > > of_address_to_resource(mdio, 0, &res);
> > >- snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 1);
> > >+ snprintf(phy_id, BUS_ID_SIZE, "%llx:%02x", (u64)res.start, 1);
> > ^^^
> >unsigned long? u64 differs for 32-bit and 64-bit.
>
> This is proper. This is a 32-bit only platform (and the format is long long).
Sorry, I meant `unsigned long long'.
One day someone may copy-and-paste to a 64-bit platform...
> >Doh, if you would put the whole resource range there, you could use %pR ;-)
>
> and if we had a %R ... :)
... we would have a hard job teaching gcc how to handle it ;-)
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-03 16:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 15:38 [PATCH] powerpc/85xx: Fix compile warnings in mpc85xx_mds.c Kumar Gala
2008-12-03 16:17 ` Geert Uytterhoeven
2008-12-03 16:21 ` Kumar Gala
2008-12-03 16:43 ` Geert Uytterhoeven
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).