Commit 2615c93e authored by Jonathan Neuschäfer's avatar Jonathan Neuschäfer Committed by Michael Ellerman

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: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 041413b8
...@@ -85,13 +85,7 @@ int page_is_ram(unsigned long pfn) ...@@ -85,13 +85,7 @@ int page_is_ram(unsigned long pfn)
#ifndef CONFIG_PPC64 /* XXX for now */ #ifndef CONFIG_PPC64 /* XXX for now */
return pfn < max_pfn; return pfn < max_pfn;
#else #else
unsigned long paddr = (pfn << PAGE_SHIFT); return memblock_is_memory(__pfn_to_phys(pfn));
struct memblock_region *reg;
for_each_memblock(memory, reg)
if (paddr >= reg->base && paddr < (reg->base + reg->size))
return 1;
return 0;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment