Skip to content

Commit

Permalink
ARM: LMB: convert pfn_valid to use LMB
Browse files Browse the repository at this point in the history
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jul 27, 2010
1 parent eda2e5d commit e07b9e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,15 @@ static void __init arm_bootmem_free(struct meminfo *mi)
#ifndef CONFIG_SPARSEMEM
int pfn_valid(unsigned long pfn)
{
struct meminfo *mi = &meminfo;
unsigned int left = 0, right = mi->nr_banks;
struct memblock_region *mem = &memblock.memory;
unsigned int left = 0, right = mem->cnt;

do {
unsigned int mid = (right + left) / 2;
struct membank *bank = &mi->bank[mid];

if (pfn < bank_pfn_start(bank))
if (pfn < memblock_start_pfn(mem, mid))
right = mid;
else if (pfn >= bank_pfn_end(bank))
else if (pfn >= memblock_end_pfn(mem, mid))
left = mid + 1;
else
return 1;
Expand Down

0 comments on commit e07b9e0

Please sign in to comment.