diff mbox series

[v2] MIPS: Loongson64: Fix section mismatch warning

Message ID 1656313633-1713-1-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Accepted
Commit 08472f6ebdc23334ad11dcd761d2d52c32897793
Headers show
Series [v2] MIPS: Loongson64: Fix section mismatch warning | expand

Commit Message

Tiezhu Yang June 27, 2022, 7:07 a.m. UTC
prom_init_numa_memory() is annotated __init and not used by any module,
thus don't export it.

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

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

This is build on Linux 5.19-rc4.

Fixes: 6fbde6b492df ("MIPS: Loongson64: Move files to the top-level directory")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

v2: update the commit message and add Fixes tag

 arch/mips/loongson64/numa.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Tiezhu Yang June 28, 2022, 12:14 a.m. UTC | #1
Cc Masahiro Yamada <masahiroy@kernel.org>

On 06/27/2022 03:07 PM, Tiezhu Yang wrote:
> prom_init_numa_memory() is annotated __init and not used by any module,
> thus don't export it.
>
> Remove not needed EXPORT_SYMBOL for prom_init_numa_memory() to fix the
> following section mismatch warning:
>
>   LD      vmlinux.o
>   MODPOST vmlinux.symvers
> WARNING: modpost: vmlinux.o(___ksymtab+prom_init_numa_memory+0x0): Section mismatch in reference
> from the variable __ksymtab_prom_init_numa_memory to the function .init.text:prom_init_numa_memory()
> The symbol prom_init_numa_memory is exported and annotated __init
> Fix this by removing the __init annotation of prom_init_numa_memory or drop the export.
>
> This is build on Linux 5.19-rc4.
>
> Fixes: 6fbde6b492df ("MIPS: Loongson64: Move files to the top-level directory")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>
> v2: update the commit message and add Fixes tag
>
>  arch/mips/loongson64/numa.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
> index 69a5331..8f61e93 100644
> --- a/arch/mips/loongson64/numa.c
> +++ b/arch/mips/loongson64/numa.c
> @@ -196,7 +196,6 @@ void __init prom_init_numa_memory(void)
>  	pr_info("CP0_PageGrain: CP0 5.1 (0x%x)\n", read_c0_pagegrain());
>  	prom_meminit();
>  }
> -EXPORT_SYMBOL(prom_init_numa_memory);
>
>  pg_data_t * __init arch_alloc_nodedata(int nid)
>  {
>

Hi Masahiro,

Please review this patch, 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
Huacai Chen June 28, 2022, 7:28 a.m. UTC | #2
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>

On Tue, Jun 28, 2022 at 8:16 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> Cc Masahiro Yamada <masahiroy@kernel.org>
>
> On 06/27/2022 03:07 PM, Tiezhu Yang wrote:
> > prom_init_numa_memory() is annotated __init and not used by any module,
> > thus don't export it.
> >
> > Remove not needed EXPORT_SYMBOL for prom_init_numa_memory() to fix the
> > following section mismatch warning:
> >
> >   LD      vmlinux.o
> >   MODPOST vmlinux.symvers
> > WARNING: modpost: vmlinux.o(___ksymtab+prom_init_numa_memory+0x0): Section mismatch in reference
> > from the variable __ksymtab_prom_init_numa_memory to the function .init.text:prom_init_numa_memory()
> > The symbol prom_init_numa_memory is exported and annotated __init
> > Fix this by removing the __init annotation of prom_init_numa_memory or drop the export.
> >
> > This is build on Linux 5.19-rc4.
> >
> > Fixes: 6fbde6b492df ("MIPS: Loongson64: Move files to the top-level directory")
> > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> > ---
> >
> > v2: update the commit message and add Fixes tag
> >
> >  arch/mips/loongson64/numa.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
> > index 69a5331..8f61e93 100644
> > --- a/arch/mips/loongson64/numa.c
> > +++ b/arch/mips/loongson64/numa.c
> > @@ -196,7 +196,6 @@ void __init prom_init_numa_memory(void)
> >       pr_info("CP0_PageGrain: CP0 5.1 (0x%x)\n", read_c0_pagegrain());
> >       prom_meminit();
> >  }
> > -EXPORT_SYMBOL(prom_init_numa_memory);
> >
> >  pg_data_t * __init arch_alloc_nodedata(int nid)
> >  {
> >
>
> Hi Masahiro,
>
> Please review this patch, 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
>
Thomas Bogendoerfer July 5, 2022, 10:24 a.m. UTC | #3
On Mon, Jun 27, 2022 at 03:07:13PM +0800, Tiezhu Yang wrote:
> prom_init_numa_memory() is annotated __init and not used by any module,
> thus don't export it.
> 
> Remove not needed EXPORT_SYMBOL for prom_init_numa_memory() to fix the
> following section mismatch warning:
> 
>   LD      vmlinux.o
>   MODPOST vmlinux.symvers
> WARNING: modpost: vmlinux.o(___ksymtab+prom_init_numa_memory+0x0): Section mismatch in reference
> from the variable __ksymtab_prom_init_numa_memory to the function .init.text:prom_init_numa_memory()
> The symbol prom_init_numa_memory is exported and annotated __init
> Fix this by removing the __init annotation of prom_init_numa_memory or drop the export.
> 
> This is build on Linux 5.19-rc4.
> 
> Fixes: 6fbde6b492df ("MIPS: Loongson64: Move files to the top-level directory")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> 
> v2: update the commit message and add Fixes tag
> 
>  arch/mips/loongson64/numa.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
> index 69a5331..8f61e93 100644
> --- a/arch/mips/loongson64/numa.c
> +++ b/arch/mips/loongson64/numa.c
> @@ -196,7 +196,6 @@ void __init prom_init_numa_memory(void)
>  	pr_info("CP0_PageGrain: CP0 5.1 (0x%x)\n", read_c0_pagegrain());
>  	prom_meminit();
>  }
> -EXPORT_SYMBOL(prom_init_numa_memory);
>  
>  pg_data_t * __init arch_alloc_nodedata(int nid)
>  {
> -- 
> 2.1.0

applied to mips-next.

Thomas.
diff mbox series

Patch

diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
index 69a5331..8f61e93 100644
--- a/arch/mips/loongson64/numa.c
+++ b/arch/mips/loongson64/numa.c
@@ -196,7 +196,6 @@  void __init prom_init_numa_memory(void)
 	pr_info("CP0_PageGrain: CP0 5.1 (0x%x)\n", read_c0_pagegrain());
 	prom_meminit();
 }
-EXPORT_SYMBOL(prom_init_numa_memory);
 
 pg_data_t * __init arch_alloc_nodedata(int nid)
 {