Skip to contentSkip to conversation

LoongArch: Fixed arch_remove_memory undefined build error.

PATCH Applied Yupeng Li 2 participants 2 messages Aug 31, 2022 – Sep 4, 2022 LoongArch

lore
Share & tools
lore

Yupeng Li

author
#0 lore raw

PATCH 1/1 LoongArch: Fixed arch_remove_memory undefined build error.

The kernel build error when unslected CONFIG_MEMORY_HOTREMOVE, the arch_remove_memory in mm/memory_hotplug.c was undefined. Removed CONFIG_MEMORY_HOTREMOVE requirement refer to the definitions of other platform architectures.Some build error messages like:

LD vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD .tmp_vmlinux.kallsyms1
loongarch64-linux-gnu-ld: mm/memory_hotplug.o: in function `.L242':
memory_hotplug.c:(.ref.text+0x930): undefined reference to `arch_remove_memory'
make: *** [Makefile:1169:vmlinux] 错误 1

---
 arch/loongarch/mm/init.c | 2 --
 1 file changed, 2 deletions(-)
arch/loongarch/mm/init.c +0 -2
index 7094a68c9b83..191ed8e47895 100644
@@ -142,7 +142,6 @@ int memory_add_physaddr_to_nid(u64 start)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
-#ifdef CONFIG_MEMORY_HOTREMOVE
 void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
 {
 	unsigned long start_pfn = start >> PAGE_SHIFT;
@@ -155,7 +154,6 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
 	__remove_pages(start_pfn, nr_pages, altmap);
 }
 #endif
-#endif
 
 /*
  * Align swapper_pg_dir in to 64K, allows its address to be loaded
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw

Applied to loongarch-fixes, thanks.

Huacai

Quoted 45 lines · Yupeng Li

The kernel build error when unslected CONFIG_MEMORY_HOTREMOVE, the arch_remove_memory in mm/memory_hotplug.c was undefined. Removed CONFIG_MEMORY_HOTREMOVE requirement refer to the definitions of other platform architectures.Some build error messages like:

LD vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD .tmp_vmlinux.kallsyms1
loongarch64-linux-gnu-ld: mm/memory_hotplug.o: in function `.L242':
memory_hotplug.c:(.ref.text+0x930): undefined reference to `arch_remove_memory'
make: *** [Makefile:1169:vmlinux] 错误 1

---
 arch/loongarch/mm/init.c | 2 --
 1 file changed, 2 deletions(-)
arch/loongarch/mm/init.c +0 -3
index 7094a68c9b83..191ed8e47895 100644
@@ -142,7 +142,6 @@ int memory_add_physaddr_to_nid(u64 start)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
-#ifdef CONFIG_MEMORY_HOTREMOVE
 void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
 {
        unsigned long start_pfn = start >> PAGE_SHIFT;
@@ -155,7 +154,6 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
        __remove_pages(start_pfn, nr_pages, altmap);
 }
 #endif
-#endif
 
 /*
  * Align swapper_pg_dir in to 64K, allows its address to be loaded
--

2.34.1