Skip to contentSkip to conversation

powerpc: Abolish PHYS_FMT macro from arch/powerpc

PATCH David Gibson 3 participants 3 messages Apr 24, 2007 – Apr 26, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

32-bit powerpc systems define a macro, PHYS_FMT, giving a printf format string fragment for displaying physical addresses, since most 32-bit powerpc platforms use 32-bit physical addresses but a few use 64-bit physical addresses.

This macro is used in exactly one place, a rare error message, where we can solve the problem more simply by just unconditionally casting the address up to 64-bit quantity before formatting it.

This patch does so, meaning that as we bring MMU definitions from asm-ppc over to asm-powerpc, cleaning them up in the process, we don't need to implement this ugly macro (which additionally has a very bad name for something global).

arch/powerpc/mm/pgtable_32.c +2 -2
Index: working-2.6/arch/powerpc/mm/pgtable_32.c
===================================================================
@@ -183,8 +183,8 @@ __ioremap(phys_addr_t addr, unsigned lon
 	 * mem_init() sets high_memory so only do the check after that.
 	 */
 	if (mem_init_done && (p < virt_to_phys(high_memory))) {
-		printk("__ioremap(): phys addr "PHYS_FMT" is RAM lr %p\n", p,
-		       __builtin_return_address(0));
+		printk("__ioremap(): phys addr 0x%llx is RAM lr %p\n",
+		       (unsigned long long)p, __builtin_return_address(0));
 		return NULL;
 	}
 
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#1 lore raw
Quoted 1 line · David Gibson

32-bit powerpc systems define a macro, PHYS_FMT, giving a printf

Your patch removed the use of the macro, but does not remove the definition of the macro.

--linas

#2 lore raw
Quoted 5 lines · Linas Vepstas
Quoted 1 line · David Gibson

32-bit powerpc systems define a macro, PHYS_FMT, giving a printf

Your patch removed the use of the macro, but does not remove the definition of the macro.

Yes, that's because the definition is in asm-ppc, and it's still used in asm-ppc. My upcoming patches which start to remove arch/powerpc's final dependencies on asm-ppc won't be moving PHYS_FMT across.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson