memblock/sparc: Use new accessors

CC: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 64106ca6
...@@ -972,13 +972,13 @@ int of_node_to_nid(struct device_node *dp) ...@@ -972,13 +972,13 @@ int of_node_to_nid(struct device_node *dp)
static void __init add_node_ranges(void) static void __init add_node_ranges(void)
{ {
int i; struct memblock_region *reg;
for (i = 0; i < memblock.memory.cnt; i++) { for_each_memblock(memory, reg) {
unsigned long size = memblock_size_bytes(&memblock.memory, i); unsigned long size = reg->size;
unsigned long start, end; unsigned long start, end;
start = memblock.memory.regions[i].base; start = reg->base;
end = start + size; end = start + size;
while (start < end) { while (start < end) {
unsigned long this_end; unsigned long this_end;
...@@ -1281,7 +1281,7 @@ static void __init bootmem_init_nonnuma(void) ...@@ -1281,7 +1281,7 @@ static void __init bootmem_init_nonnuma(void)
{ {
unsigned long top_of_ram = memblock_end_of_DRAM(); unsigned long top_of_ram = memblock_end_of_DRAM();
unsigned long total_ram = memblock_phys_mem_size(); unsigned long total_ram = memblock_phys_mem_size();
unsigned int i; struct memblock_region *reg;
numadbg("bootmem_init_nonnuma()\n"); numadbg("bootmem_init_nonnuma()\n");
...@@ -1292,15 +1292,14 @@ static void __init bootmem_init_nonnuma(void) ...@@ -1292,15 +1292,14 @@ static void __init bootmem_init_nonnuma(void)
init_node_masks_nonnuma(); init_node_masks_nonnuma();
for (i = 0; i < memblock.memory.cnt; i++) { for_each_memblock(memory, reg) {
unsigned long size = memblock_size_bytes(&memblock.memory, i);
unsigned long start_pfn, end_pfn; unsigned long start_pfn, end_pfn;
if (!size) if (!reg->size)
continue; continue;
start_pfn = memblock.memory.regions[i].base >> PAGE_SHIFT; start_pfn = memblock_region_base_pfn(reg);
end_pfn = start_pfn + memblock_size_pages(&memblock.memory, i); end_pfn = memblock_region_end_pfn(reg);
add_active_range(0, start_pfn, end_pfn); add_active_range(0, start_pfn, end_pfn);
} }
...@@ -1334,17 +1333,12 @@ static void __init reserve_range_in_node(int nid, unsigned long start, ...@@ -1334,17 +1333,12 @@ static void __init reserve_range_in_node(int nid, unsigned long start,
static void __init trim_reserved_in_node(int nid) static void __init trim_reserved_in_node(int nid)
{ {
int i; struct memblock_region *reg;
numadbg(" trim_reserved_in_node(%d)\n", nid); numadbg(" trim_reserved_in_node(%d)\n", nid);
for (i = 0; i < memblock.reserved.cnt; i++) { for_each_memblock(reserved, reg)
unsigned long start = memblock.reserved.regions[i].base; reserve_range_in_node(nid, reg->base, reg->base + reg->size);
unsigned long size = memblock_size_bytes(&memblock.reserved, i);
unsigned long end = start + size;
reserve_range_in_node(nid, start, end);
}
} }
static void __init bootmem_init_one_node(int nid) static void __init bootmem_init_one_node(int nid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment