Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[sfrench/cifs-2.6.git] / arch / powerpc / mm / numa.c
index bd2cf13368853f0518fbf5e018f8b2069b6998d8..ba7a3055a9fc42f20b70f80b7bc298f40137a559 100644 (file)
@@ -125,7 +125,7 @@ void __init get_region(unsigned int nid, unsigned long *start_pfn,
 
        /* We didnt find a matching region, return start/end as 0 */
        if (*start_pfn == -1UL)
-               start_pfn = 0;
+               *start_pfn = 0;
 }
 
 static inline void map_cpu_to_node(int cpu, int node)
@@ -483,6 +483,7 @@ static void __init setup_nonnuma(void)
 {
        unsigned long top_of_ram = lmb_end_of_DRAM();
        unsigned long total_ram = lmb_phys_mem_size();
+       unsigned int i;
 
        printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
               top_of_ram, total_ram);
@@ -490,7 +491,9 @@ static void __init setup_nonnuma(void)
               (top_of_ram - total_ram) >> 20);
 
        map_cpu_to_node(boot_cpuid, 0);
-       add_region(0, 0, lmb_end_of_DRAM() >> PAGE_SHIFT);
+       for (i = 0; i < lmb.memory.cnt; ++i)
+               add_region(0, lmb.memory.region[i].base >> PAGE_SHIFT,
+                          lmb_size_pages(&lmb.memory, i));
        node_set_online(0);
 }