summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/mem.c
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-03-28 02:25:40 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-03-31 15:47:42 +0200
commit2615c93e5f52db62586112793d889face99eb905 (patch)
tree53efed7c8daa258b0f96523acfdc4de6ca984ce2 /arch/powerpc/mm/mem.c
parentpowerpc/wii.dts: Add drive slot LED (diff)
downloadlinux-2615c93e5f52db62586112793d889face99eb905.tar.xz
linux-2615c93e5f52db62586112793d889face99eb905.zip
powerpc/mm: Simplify page_is_ram by using memblock_is_memory
Instead of open-coding the search in page_is_ram, call memblock_is_memory. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r--arch/powerpc/mm/mem.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index e2f5025b03b0..8f335cf052f8 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -85,13 +85,7 @@ int page_is_ram(unsigned long pfn)
#ifndef CONFIG_PPC64 /* XXX for now */
return pfn < max_pfn;
#else
- unsigned long paddr = (pfn << PAGE_SHIFT);
- struct memblock_region *reg;
-
- for_each_memblock(memory, reg)
- if (paddr >= reg->base && paddr < (reg->base + reg->size))
- return 1;
- return 0;
+ return memblock_is_memory(__pfn_to_phys(pfn));
#endif
}