LoongArch: Fixed arch_remove_memory undefined build error.
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
@@ -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
Applied to loongarch-fixes, thanks.
Huacai
Quoted 45 lines · Yupeng Li
The kernel build error when unslected
CONFIG_MEMORY_HOTREMOVE, thearch_remove_memoryinmm/memory_hotplug.cwas undefined. RemovedCONFIG_MEMORY_HOTREMOVErequirement 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] 错误 1Signed-off-by Yupeng Li <[email protected]>Signed-off-by Caicai <[email protected]>--- arch/loongarch/mm/init.c | 2 -- 1 file changed, 2 deletions(-)arch/loongarch/mm/init.c +0
-3@@ -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