[PATCH] ppc64: Simplify some lmb functions

lmb_phys_mem_size() can always return lmb.memory.size, as long as it's called
after lmb_analyze(), which it is. There's no need to recalculate the size on
every call.

lmb_analyze() was calculating a few things we then threw away, so just don't
calculate them to start with.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Michael Ellerman and committed by
Paul Mackerras
71e1f55a 180379dc

+5 -22
+5 -22
arch/ppc64/kernel/lmb.c
··· 119 119 void __init 120 120 lmb_analyze(void) 121 121 { 122 - unsigned long i; 123 - unsigned long mem_size = 0; 124 - unsigned long size_mask = 0; 122 + int i; 125 123 126 - for (i=0; i < lmb.memory.cnt; i++) { 127 - unsigned long lmb_size; 124 + lmb.memory.size = 0; 128 125 129 - lmb_size = lmb.memory.region[i].size; 130 - 131 - mem_size += lmb_size; 132 - size_mask |= lmb_size; 133 - } 134 - 135 - lmb.memory.size = mem_size; 126 + for (i = 0; i < lmb.memory.cnt; i++) 127 + lmb.memory.size += lmb.memory.region[i].size; 136 128 } 137 129 138 130 /* This routine called with relocation disabled. */ ··· 258 266 return base; 259 267 } 260 268 269 + /* You must call lmb_analyze() before this. */ 261 270 unsigned long __init 262 271 lmb_phys_mem_size(void) 263 272 { 264 - #ifdef CONFIG_MSCHUNKS 265 273 return lmb.memory.size; 266 - #else 267 - unsigned long total = 0; 268 - int i; 269 - 270 - /* add all physical memory to the bootmem map */ 271 - for (i=0; i < lmb.memory.cnt; i++) 272 - total += lmb.memory.region[i].size; 273 - return total; 274 - #endif /* CONFIG_MSCHUNKS */ 275 274 } 276 275 277 276 unsigned long __init