Skip to content

Commit

Permalink
memblock/sparc: Use new accessors
Browse files Browse the repository at this point in the history
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Benjamin Herrenschmidt committed Aug 4, 2010
1 parent 64106ca commit 08b8479
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions arch/sparc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,13 @@ int of_node_to_nid(struct device_node *dp)

static void __init add_node_ranges(void)
{
int i;
struct memblock_region *reg;

for (i = 0; i < memblock.memory.cnt; i++) {
unsigned long size = memblock_size_bytes(&memblock.memory, i);
for_each_memblock(memory, reg) {
unsigned long size = reg->size;
unsigned long start, end;

start = memblock.memory.regions[i].base;
start = reg->base;
end = start + size;
while (start < end) {
unsigned long this_end;
Expand Down Expand Up @@ -1281,7 +1281,7 @@ static void __init bootmem_init_nonnuma(void)
{
unsigned long top_of_ram = memblock_end_of_DRAM();
unsigned long total_ram = memblock_phys_mem_size();
unsigned int i;
struct memblock_region *reg;

numadbg("bootmem_init_nonnuma()\n");

Expand All @@ -1292,15 +1292,14 @@ static void __init bootmem_init_nonnuma(void)

init_node_masks_nonnuma();

for (i = 0; i < memblock.memory.cnt; i++) {
unsigned long size = memblock_size_bytes(&memblock.memory, i);
for_each_memblock(memory, reg) {
unsigned long start_pfn, end_pfn;

if (!size)
if (!reg->size)
continue;

start_pfn = memblock.memory.regions[i].base >> PAGE_SHIFT;
end_pfn = start_pfn + memblock_size_pages(&memblock.memory, i);
start_pfn = memblock_region_base_pfn(reg);
end_pfn = memblock_region_end_pfn(reg);
add_active_range(0, start_pfn, end_pfn);
}

Expand Down Expand Up @@ -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)
{
int i;
struct memblock_region *reg;

numadbg(" trim_reserved_in_node(%d)\n", nid);

for (i = 0; i < memblock.reserved.cnt; i++) {
unsigned long start = memblock.reserved.regions[i].base;
unsigned long size = memblock_size_bytes(&memblock.reserved, i);
unsigned long end = start + size;

reserve_range_in_node(nid, start, end);
}
for_each_memblock(reserved, reg)
reserve_range_in_node(nid, reg->base, reg->base + reg->size);
}

static void __init bootmem_init_one_node(int nid)
Expand Down

0 comments on commit 08b8479

Please sign in to comment.