linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/prom: fix early DEBUG messages
@ 2018-12-13 13:54 Christophe Leroy
  2018-12-14  6:22 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2018-12-13 13:54 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linuxppc-dev, linux-kernel

This patch fixes early DEBUG messages in prom.c:
- Use %px instead of %p to see the addresses
- Use %x instead of %llx when phys_addr_t is not 64 bits.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/prom.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index fe758cedb93f..d8e56e03c9c6 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -129,7 +129,7 @@ static void __init move_device_tree(void)
 		p = __va(memblock_phys_alloc(size, PAGE_SIZE));
 		memcpy(p, initial_boot_params, size);
 		initial_boot_params = p;
-		DBG("Moved device tree to 0x%p\n", p);
+		DBG("Moved device tree to 0x%px\n", p);
 	}
 
 	DBG("<- move_device_tree\n");
@@ -689,7 +689,7 @@ void __init early_init_devtree(void *params)
 {
 	phys_addr_t limit;
 
-	DBG(" -> early_init_devtree(%p)\n", params);
+	DBG(" -> early_init_devtree(%px)\n", params);
 
 	/* Too early to BUG_ON(), do it by hand */
 	if (!early_init_dt_verify(params))
@@ -749,7 +749,11 @@ void __init early_init_devtree(void *params)
 	memblock_allow_resize();
 	memblock_dump_all();
 
+#ifdef CONFIG_PHYS_64BIT
 	DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
+#else
+	DBG("Phys. mem: %x\n", memblock_phys_mem_size());
+#endif
 
 	/* We may need to relocate the flat tree, do it now.
 	 * FIXME .. and the initrd too? */
-- 
2.13.3


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

* Re: [PATCH] powerpc/prom: fix early DEBUG messages
  2018-12-13 13:54 [PATCH] powerpc/prom: fix early DEBUG messages Christophe Leroy
@ 2018-12-14  6:22 ` Michael Ellerman
  2018-12-14 10:37   ` Christophe Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2018-12-14  6:22 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index fe758cedb93f..d8e56e03c9c6 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -749,7 +749,11 @@ void __init early_init_devtree(void *params)
>  	memblock_allow_resize();
>  	memblock_dump_all();
>  
> +#ifdef CONFIG_PHYS_64BIT
>  	DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
> +#else
> +	DBG("Phys. mem: %x\n", memblock_phys_mem_size());
> +#endif

Can we just do:

  	DBG("Phys. mem: %llx\n", (unsigned long long)memblock_phys_mem_size());

?

cheers

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

* Re: [PATCH] powerpc/prom: fix early DEBUG messages
  2018-12-14  6:22 ` Michael Ellerman
@ 2018-12-14 10:37   ` Christophe Leroy
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe Leroy @ 2018-12-14 10:37 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel



Le 14/12/2018 à 07:22, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@c-s.fr> writes:
> 
>> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
>> index fe758cedb93f..d8e56e03c9c6 100644
>> --- a/arch/powerpc/kernel/prom.c
>> +++ b/arch/powerpc/kernel/prom.c
>> @@ -749,7 +749,11 @@ void __init early_init_devtree(void *params)
>>   	memblock_allow_resize();
>>   	memblock_dump_all();
>>   
>> +#ifdef CONFIG_PHYS_64BIT
>>   	DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
>> +#else
>> +	DBG("Phys. mem: %x\n", memblock_phys_mem_size());
>> +#endif
> 
> Can we just do:
> 
>    	DBG("Phys. mem: %llx\n", (unsigned long long)memblock_phys_mem_size());
> 
> ?
> 

Yes that's obviously better, especially as we don't fix the length of 
the displayed value.
Christophe

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

end of thread, other threads:[~2018-12-14 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 13:54 [PATCH] powerpc/prom: fix early DEBUG messages Christophe Leroy
2018-12-14  6:22 ` Michael Ellerman
2018-12-14 10:37   ` Christophe Leroy

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