[PATCH] LoongArch: Fix section mismatch warning

Tiezhu Yang posted 1 patch 3 years, 9 months ago
arch/loongarch/kernel/numa.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] LoongArch: Fix section mismatch warning
Posted by Tiezhu Yang 3 years, 9 months ago
init_numa_memory() is annotated __init and not used by any module,
thus don't export it.

Remove not needed EXPORT_SYMBOL for init_numa_memory() to fix the
following section mismatch warning:

  MODPOST vmlinux.symvers
WARNING: modpost: vmlinux.o(___ksymtab+init_numa_memory+0x0): Section mismatch in reference
from the variable __ksymtab_init_numa_memory to the function .init.text:init_numa_memory()
The symbol init_numa_memory is exported and annotated __init
Fix this by removing the __init annotation of init_numa_memory or drop the export.

This is build on Linux 5.19-rc4.

Fixes: d4b6f1562a3c ("LoongArch: Add Non-Uniform Memory Access (NUMA) support")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/kernel/numa.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/loongarch/kernel/numa.c b/arch/loongarch/kernel/numa.c
index a76f547..a13f925 100644
--- a/arch/loongarch/kernel/numa.c
+++ b/arch/loongarch/kernel/numa.c
@@ -429,7 +429,6 @@ int __init init_numa_memory(void)
 	return 0;
 }
 
-EXPORT_SYMBOL(init_numa_memory);
 #endif
 
 void __init paging_init(void)
-- 
2.1.0
Re: [PATCH] LoongArch: Fix section mismatch warning
Posted by Tiezhu Yang 3 years, 9 months ago
Cc Masahiro Yamada <masahiroy@kernel.org>

Hi Masahiro,

Please review this patch.

https://lore.kernel.org/lkml/1656313055-547-1-git-send-email-yangtiezhu@loongson.cn/

I think it is related with the following issue, thank you.

https://lore.kernel.org/lkml/CAHk-=wgcsUU-TNoLS7Q6YF3RCSVAKwNM7gFOwqnPQTiU_oGEWA@mail.gmail.com/

Thanks,
Tiezhu
Re: [PATCH] LoongArch: Fix section mismatch warning
Posted by Huacai Chen 3 years, 9 months ago
Applied to loongarch-fixes, thanks.

Huacai

On Tue, Jun 28, 2022 at 8:18 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> Cc Masahiro Yamada <masahiroy@kernel.org>
>
> Hi Masahiro,
>
> Please review this patch.
>
> https://lore.kernel.org/lkml/1656313055-547-1-git-send-email-yangtiezhu@loongson.cn/
>
> I think it is related with the following issue, thank you.
>
> https://lore.kernel.org/lkml/CAHk-=wgcsUU-TNoLS7Q6YF3RCSVAKwNM7gFOwqnPQTiU_oGEWA@mail.gmail.com/
>
> Thanks,
> Tiezhu
>