Skip to content

Commit

Permalink
mm/memblock.c: use PFN_PHYS()
Browse files Browse the repository at this point in the history
Replace ((phys_addr_t)(x) << PAGE_SHIFT) by pfn macro.

Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Apr 7, 2014
1 parent 136199f commit 1676323
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ phys_addr_t __init memblock_mem_size(unsigned long limit_pfn)
pages += end_pfn - start_pfn;
}

return (phys_addr_t)pages << PAGE_SHIFT;
return PFN_PHYS(pages);
}

/* lowest address */
Expand Down Expand Up @@ -1324,7 +1324,7 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
unsigned long *start_pfn, unsigned long *end_pfn)
{
struct memblock_type *type = &memblock.memory;
int mid = memblock_search(type, (phys_addr_t)pfn << PAGE_SHIFT);
int mid = memblock_search(type, PFN_PHYS(pfn));

if (mid == -1)
return -1;
Expand Down

0 comments on commit 1676323

Please sign in to comment.