setup_64.c:450: warning: format '%lx' expects type 'long unsigned int'

4 messages, 3 authors, 2009-02-18 · open the first message on its own page

setup_64.c:450: warning: format '%lx' expects type 'long unsigned int'

From: Geert Uytterhoeven <hidden>
Date: 2009-02-17 13:21:17

With CONFIG_RELOCATABLE=y, I get for PS3:

| arch/powerpc/kernel/setup_64.c:450: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'phys_addr_t'

as phys_addr_t is u64 on ppc64, while u64 is now `unsigned long long'.

Unfortunately just changing the format string is not sufficient, due to:

| #if defined(CONFIG_RELOCATABLE)
| #ifndef __ASSEMBLY__
| 
| extern phys_addr_t memstart_addr;
| extern phys_addr_t kernstart_addr;
| #endif
| #define PHYSICAL_START  kernstart_addr
| #else
| #define PHYSICAL_START  ASM_CONST(CONFIG_PHYSICAL_START)
| #endif

and ASM_CONST() appends "UL" to the constant.

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

Re: setup_64.c:450: warning: format '%lx' expects type 'long unsigned int'

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2009-02-18 06:03:57

On Tue, 2009-02-17 at 14:21 +0100, Geert Uytterhoeven wrote:
and ASM_CONST() appends "UL" to the constant.
We probably want to add a ASM_ULL_CONST() for that...

Ben.

Re: setup_64.c:450: warning: format '%lx' expects type 'long unsigned int'

From: Stephen Rothwell <hidden>
Date: 2009-02-18 06:17:13

On Wed, 18 Feb 2009 17:03:50 +1100 Benjamin Herrenschmidt [off-list ref] wrote:
On Tue, 2009-02-17 at 14:21 +0100, Geert Uytterhoeven wrote:
quoted
and ASM_CONST() appends "UL" to the constant.
We probably want to add a ASM_ULL_CONST() for that...
Except physaddr_t is sometimes 32 bits and sometime 64 bits in the 32 bit
kernel ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Re: setup_64.c:450: warning: format '%lx' expects type 'long unsigned int'

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2009-02-18 06:19:21

On Wed, 2009-02-18 at 17:16 +1100, Stephen Rothwell wrote:
On Wed, 18 Feb 2009 17:03:50 +1100 Benjamin Herrenschmidt [off-list ref] wrote:
quoted
On Tue, 2009-02-17 at 14:21 +0100, Geert Uytterhoeven wrote:
quoted
and ASM_CONST() appends "UL" to the constant.
We probably want to add a ASM_ULL_CONST() for that...
Except physaddr_t is sometimes 32 bits and sometime 64 bits in the 32 bit
kernel ...
Oh well, one cast that won't go away then.

Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help