Skip to contentSkip to conversation

arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG

PATCH Applied Anshuman Khandual 2 participants 2 messages May 24, 2021 – May 25, 2021 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG

vmemmap_free() callsites (mm/sparse.c) and declaration (include/linux/mm.h) are protected with CONFIG_MEMORY_HOTPLUG. This function is not required if CONFIG_MEMORY_HOTPLUG is not enabled. Hence move the config wrapper outside the function definition.

---
This applies on v5.13-rc3

 arch/arm64/mm/mmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/mm/mmu.c +3 -2
index e3b639e2461d..207d5f26c004 100644
@@ -1167,16 +1167,17 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 	return 0;
 }
 #endif	/* !ARM64_SWAPPER_USES_SECTION_MAPS */
+
+#ifdef CONFIG_MEMORY_HOTPLUG
 void vmemmap_free(unsigned long start, unsigned long end,
 		struct vmem_altmap *altmap)
 {
-#ifdef CONFIG_MEMORY_HOTPLUG
 	WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END));
 
 	unmap_hotplug_range(start, end, true, altmap);
 	free_empty_tables(start, end, VMEMMAP_START, VMEMMAP_END);
-#endif
 }
+#endif /* CONFIG_MEMORY_HOTPLUG */
 
 static inline pud_t *fixmap_pud(unsigned long addr)
 {
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Anshuman Khandual

vmemmap_free() callsites (mm/sparse.c) and declaration (include/linux/mm.h) are protected with CONFIG_MEMORY_HOTPLUG. This function is not required if CONFIG_MEMORY_HOTPLUG is not enabled. Hence move the config wrapper outside the function definition.

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG

      https://git.kernel.org/arm64/c/40221c737608

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev