[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1444415430-25827-1-git-send-email-kuleshovmail@gmail.com>
Date: Sat, 10 Oct 2015 00:30:30 +0600
From: Alexander Kuleshov <kuleshovmail@...il.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Anton Blanchard <anton@...ba.org>,
Scott Wood <scottwood@...escale.com>,
Dan Williams <dan.j.williams@...el.com>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Alexander Kuleshov <kuleshovmail@...il.com>
Subject: [PATCH] powerpc/mm: use memblock_is_memory
The <linux/memblock.h> provides memblock_is_memory() function that
tries to find a given physical address in the memblock.memory.regions.
Let's use this function instead of direct coding of the same functionality.
Signed-off-by: Alexander Kuleshov <kuleshovmail@...il.com>
---
arch/powerpc/mm/mem.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 22d94c3..85b462b 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -82,11 +82,9 @@ int page_is_ram(unsigned long pfn)
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;
+ if (memblock_is_memory(paddr))
+ return 1;
return 0;
#endif
}
--
2.6.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists