linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: mark prepare_page_table as __init
@ 2021-05-11  9:03 Arnd Bergmann
  2021-05-11  9:13 ` Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-05-11  9:03 UTC (permalink / raw)
  To: Russell King
  Cc: Arnd Bergmann, Mike Rapoport, Ard Biesheuvel, Linus Walleij,
	Andrew Morton, Hailong Liu, Changbin Du, linux-arm-kernel,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

In some configurations when building with gcc-11, prepare_page_table
does not get inline, which causes a build time warning for a section
mismatch:

WARNING: modpost: vmlinux.o(.text.unlikely+0xce8): Section mismatch in reference from the function prepare_page_table() to the (unknown reference) .init.data:(unknown)
The function prepare_page_table() references
the (unknown reference) __initdata (unknown).
This is often because prepare_page_table lacks a __initdata
annotation or the annotation of (unknown) is wrong.

Mark the function as __init to avoid the warning regardless of the
inlining.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 051f4f82414b..5220b8147f40 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1246,7 +1246,7 @@ void __init adjust_lowmem_bounds(void)
 	memblock_set_current_limit(memblock_limit);
 }
 
-static inline void prepare_page_table(void)
+static inline __init void prepare_page_table(void)
 {
 	unsigned long addr;
 	phys_addr_t end;
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: mark prepare_page_table as __init
  2021-05-11  9:03 [PATCH] ARM: mark prepare_page_table as __init Arnd Bergmann
@ 2021-05-11  9:13 ` Ard Biesheuvel
  2021-05-11 14:37 ` Russell King - ARM Linux admin
  2021-05-17 10:21 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2021-05-11  9:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Russell King, Arnd Bergmann, Mike Rapoport, Linus Walleij,
	Andrew Morton, Hailong Liu, Changbin Du, Linux ARM,
	Linux Kernel Mailing List

On Tue, 11 May 2021 at 11:04, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> In some configurations when building with gcc-11, prepare_page_table
> does not get inline, which causes a build time warning for a section
> mismatch:
>
> WARNING: modpost: vmlinux.o(.text.unlikely+0xce8): Section mismatch in reference from the function prepare_page_table() to the (unknown reference) .init.data:(unknown)
> The function prepare_page_table() references
> the (unknown reference) __initdata (unknown).
> This is often because prepare_page_table lacks a __initdata
> annotation or the annotation of (unknown) is wrong.
>
> Mark the function as __init to avoid the warning regardless of the
> inlining.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I think the inline should be dropped here. Either inlining is
absolutely required for correct code generation (which is rare), or
the inline is optional, and better left up to the compiler, especially
given that this is __init code so the time/space tradeoff is moot
anyway.

With or without that change,

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> ---
>  arch/arm/mm/mmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 051f4f82414b..5220b8147f40 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -1246,7 +1246,7 @@ void __init adjust_lowmem_bounds(void)
>         memblock_set_current_limit(memblock_limit);
>  }
>
> -static inline void prepare_page_table(void)
> +static inline __init void prepare_page_table(void)
>  {
>         unsigned long addr;
>         phys_addr_t end;
> --
> 2.29.2
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: mark prepare_page_table as __init
  2021-05-11  9:03 [PATCH] ARM: mark prepare_page_table as __init Arnd Bergmann
  2021-05-11  9:13 ` Ard Biesheuvel
@ 2021-05-11 14:37 ` Russell King - ARM Linux admin
  2021-05-17 10:21 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux admin @ 2021-05-11 14:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Arnd Bergmann, Mike Rapoport, Ard Biesheuvel, Linus Walleij,
	Andrew Morton, Hailong Liu, Changbin Du, linux-arm-kernel,
	linux-kernel

On Tue, May 11, 2021 at 11:03:13AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> In some configurations when building with gcc-11, prepare_page_table
> does not get inline, which causes a build time warning for a section
> mismatch:
> 
> WARNING: modpost: vmlinux.o(.text.unlikely+0xce8): Section mismatch in reference from the function prepare_page_table() to the (unknown reference) .init.data:(unknown)
> The function prepare_page_table() references
> the (unknown reference) __initdata (unknown).
> This is often because prepare_page_table lacks a __initdata
> annotation or the annotation of (unknown) is wrong.
> 
> Mark the function as __init to avoid the warning regardless of the
> inlining.

I think if we're doing this, it would probably also be a good idea to
drop the "inline" as well, and just let the compiler decide?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: mark prepare_page_table as __init
  2021-05-11  9:03 [PATCH] ARM: mark prepare_page_table as __init Arnd Bergmann
  2021-05-11  9:13 ` Ard Biesheuvel
  2021-05-11 14:37 ` Russell King - ARM Linux admin
@ 2021-05-17 10:21 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2021-05-17 10:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Russell King, Arnd Bergmann, Mike Rapoport, Ard Biesheuvel,
	Andrew Morton, Hailong Liu, Changbin Du, Linux ARM, linux-kernel

On Tue, May 11, 2021 at 11:04 AM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> In some configurations when building with gcc-11, prepare_page_table
> does not get inline, which causes a build time warning for a section
> mismatch:
>
> WARNING: modpost: vmlinux.o(.text.unlikely+0xce8): Section mismatch in reference from the function prepare_page_table() to the (unknown reference) .init.data:(unknown)
> The function prepare_page_table() references
> the (unknown reference) __initdata (unknown).
> This is often because prepare_page_table lacks a __initdata
> annotation or the annotation of (unknown) is wrong.
>
> Mark the function as __init to avoid the warning regardless of the
> inlining.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Like the others say, drop inline, with that:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-17 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11  9:03 [PATCH] ARM: mark prepare_page_table as __init Arnd Bergmann
2021-05-11  9:13 ` Ard Biesheuvel
2021-05-11 14:37 ` Russell King - ARM Linux admin
2021-05-17 10:21 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).