mm/memblock.c: use PFN_PHYS()
authorFabian Frederick <fabf@skynet.be>
Mon, 7 Apr 2014 22:37:53 +0000 (15:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:35:58 +0000 (16:35 -0700)
Replace ((phys_addr_t)(x) << PAGE_SHIFT) by pfn macro.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memblock.c

index c5c20c46f97e88df2198dc0dd19a3a152e1420f2..e9d6ca9a01a9a3e0b1f56029a332b51c9202455e 100644 (file)
@@ -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 */
@@ -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;