Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: mm: make use of new memblocks_present() helper
@ 2019-03-19 18:13 Logan Gunthorpe
  2019-03-19 20:42 ` Mike Rapoport
  0 siblings, 1 reply; 5+ messages in thread
From: Logan Gunthorpe @ 2019-03-19 18:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: Nicolas Pitre, Rob Herring, Florian Fainelli, Kees Cook,
	Russell King, Steven Rostedt (VMware), Mike Rapoport,
	Philip Derrin, Andrew Morton, Logan Gunthorpe

Cleanup the arm_memory_present() function seeing it's very
similar to other arches.

The new memblocks_present() helper checks for node ids which the
arm version did not. However, this is equivalent seeing
HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore
memblock_get_region_node() should return 0.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Cc: Philip Derrin <philip@cog.systems>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

This is just a resend.

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 478ea8b7db87..6c50dd407ba8 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)
 EXPORT_SYMBOL(pfn_valid);
 #endif

-#ifndef CONFIG_SPARSEMEM
-static void __init arm_memory_present(void)
-{
-}
-#else
-static void __init arm_memory_present(void)
-{
-	struct memblock_region *reg;
-
-	for_each_memblock(memory, reg)
-		memory_present(0, memblock_region_memory_base_pfn(reg),
-			       memblock_region_memory_end_pfn(reg));
-}
-#endif
-
 static bool arm_memblock_steal_permitted = true;

 phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
@@ -292,7 +277,7 @@ void __init bootmem_init(void)
 	 * Sparsemem tries to allocate bootmem in memory_present(),
 	 * so must be done after the fixed reservations
 	 */
-	arm_memory_present();
+	memblocks_present();

 	/*
 	 * sparse_init() needs the bootmem allocator up and running.
--
2.20.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-19 21:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 18:13 [PATCH] ARM: mm: make use of new memblocks_present() helper Logan Gunthorpe
2019-03-19 20:42 ` Mike Rapoport
2019-03-19 20:50   ` Logan Gunthorpe
2019-03-19 21:05     ` Mike Rapoport
2019-03-19 21:12       ` Logan Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox