arch, drivers: replace for_each_membock() with for_each_mem_range()
[linux-block.git] / arch / powerpc / mm / book3s64 / hash_utils.c
index c663e7ba801fce6969ea717958b7170c941935e8..b830adee51f57ebdddd93a8d9d08dff7a45ebec6 100644 (file)
@@ -7,7 +7,7 @@
  *
  * SMP scalability work:
  *    Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
- * 
+ *
  *    Module name: htab.c
  *
  *    Description:
@@ -867,8 +867,8 @@ static void __init htab_initialize(void)
        unsigned long table;
        unsigned long pteg_count;
        unsigned long prot;
-       unsigned long base = 0, size = 0;
-       struct memblock_region *reg;
+       phys_addr_t base = 0, size = 0, end;
+       u64 i;
 
        DBG(" -> htab_initialize()\n");
 
@@ -884,7 +884,7 @@ static void __init htab_initialize(void)
        /*
         * Calculate the required size of the htab.  We want the number of
         * PTEGs to equal one half the number of real pages.
-        */ 
+        */
        htab_size_bytes = htab_get_table_size();
        pteg_count = htab_size_bytes >> 7;
 
@@ -894,7 +894,7 @@ static void __init htab_initialize(void)
            firmware_has_feature(FW_FEATURE_PS3_LV1)) {
                /* Using a hypervisor which owns the htab */
                htab_address = NULL;
-               _SDR1 = 0; 
+               _SDR1 = 0;
 #ifdef CONFIG_FA_DUMP
                /*
                 * If firmware assisted dump is active firmware preserves
@@ -960,9 +960,9 @@ static void __init htab_initialize(void)
 #endif /* CONFIG_DEBUG_PAGEALLOC */
 
        /* create bolted the linear mapping in the hash table */
-       for_each_memblock(memory, reg) {
-               base = (unsigned long)__va(reg->base);
-               size = reg->size;
+       for_each_mem_range(i, &base, &end) {
+               size = end - base;
+               base = (unsigned long)__va(base);
 
                DBG("creating mapping for region: %lx..%lx (prot: %lx)\n",
                    base, size, prot);