Skip to contentSkip to conversation

rb532: do not use phys_t

PATCH In review Florian Fainelli 2 participants 2 messages Sep 11, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rb532: do not use phys_t

MIPS include types.h says that using phys_t is bad, which in fact is an unsigned long, so use an unsigned long directly.

---

arch/mips/rb532/prom.c +2 -2
index 46ca24d..c37ceda 100644
@@ -123,8 +123,8 @@ void __init prom_setup_cmdline(void)
 void __init prom_init(void)
 {
 	struct ddr_ram __iomem *ddr;
-	phys_t memsize;
-	phys_t ddrbase;
+	unsigned long memsize;
+	unsigned long ddrbase;
 
 	ddr = ioremap_nocache(ddr_reg[0].start,
 			ddr_reg[0].end - ddr_reg[0].start);
#1 lore raw
Quoted 2 lines · Florian Fainelli

MIPS include types.h says that using phys_t is bad, which in fact is an unsigned long, so use an unsigned long directly.

That is bad indeed. A physical address might not fit in unsigned long.
Actually the upstream is apparently adopting phys_addr_t for this purpose right now, so you might consider waiting with your patch till the thing settles down. Note that by using a generic type you take away semantics which will make future adjustments more difficult.

Maciej