On Wed, 31 May 2006 18:47:54 +0200 (CEST), Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote: > > printk("initrd extends beyond end of memory " > > "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", > > `%L' is obsolete for long long, use `%ll' instead. > > > - sizeof(long) * 2, > > + (int)(sizeof(long) * 2), > > (unsigned long long)CPHYSADDR(initrd_end), > > As CPHYSADDR() returns a ptrdiff_t, what about using `%t' instead? > Ah, that one doesn't print hex (hmm, C99 doesn't seem to tell). > > You can cast to `void *' and use `%p' to get hex, and the field width will > automagically be `2*sizeof(void *)', according to lib/vsprintf.c. Thanks. Though Ralf already committed it with slight changes, this patch will make kernel just a bit smaller. [MIPS] simplify printk format string (use %p instead of %0*Lx) Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 397a70e..4ab4bd5 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -420,18 +420,15 @@ static inline void bootmem_init(void) if (initrd_start) { unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); - const int width = sizeof(long) * 2; printk("Initial ramdisk at: 0x%p (%lu bytes)\n", (void *)initrd_start, initrd_size); if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { printk("initrd extends beyond end of memory " - "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", - width, - (unsigned long long) CPHYSADDR(initrd_end), - width, - (unsigned long long) PFN_PHYS(max_low_pfn)); + "(0x%p > 0x%p)\ndisabling initrd\n", + (void *)CPHYSADDR(initrd_end), + (void *)PFN_PHYS(max_low_pfn)); initrd_start = initrd_end = 0; initrd_reserve_bootmem = 0; }