* [PATCH] initramfs: fix another section mismatch
@ 2020-04-29 19:01 Arnd Bergmann
2020-04-30 8:58 ` Mike Rapoport
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-04-29 19:01 UTC (permalink / raw)
To: Geert Uytterhoeven, Andrew Morton, Mike Rapoport
Cc: Arnd Bergmann, Christoph Hellwig, Catalin Marinas, Steven Price,
Alexander Viro, Guan Xuetao, Russell King, Will Deacon,
linux-kernel
Building with gcc-10 causes a harmless warning, similar to the
gcc-4.6 warning that Geert fixed last year:
WARNING: modpost: vmlinux.o(.text.unlikely+0xe69): Section mismatch in reference from the function kexec_free_initrd() to the function .init.text:free_initrd_mem()
The function kexec_free_initrd() references
the function __init free_initrd_mem().
This is often because kexec_free_initrd lacks a __init
annotation or the annotation of free_initrd_mem is wrong.
Add the missing __init annotations.
Fixes: 4ada1e810038 ("initramfs: fix populate_initrd_image() section mismatch")
Fixes: 23091e287355 ("initramfs: cleanup initrd freeing")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
init/initramfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/init/initramfs.c b/init/initramfs.c
index 8ec1be4d7d51..bda77a6c8e50 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -542,7 +542,7 @@ void __weak free_initrd_mem(unsigned long start, unsigned long end)
}
#ifdef CONFIG_KEXEC_CORE
-static bool kexec_free_initrd(void)
+static bool __init kexec_free_initrd(void)
{
unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
unsigned long crashk_end = (unsigned long)__va(crashk_res.end);
@@ -565,7 +565,7 @@ static bool kexec_free_initrd(void)
return true;
}
#else
-static inline bool kexec_free_initrd(void)
+static inline bool __init kexec_free_initrd(void)
{
return false;
}
--
2.26.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] initramfs: fix another section mismatch
2020-04-29 19:01 [PATCH] initramfs: fix another section mismatch Arnd Bergmann
@ 2020-04-30 8:58 ` Mike Rapoport
0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2020-04-30 8:58 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Geert Uytterhoeven, Andrew Morton, Christoph Hellwig,
Catalin Marinas, Steven Price, Alexander Viro, Guan Xuetao,
Russell King, Will Deacon, linux-kernel
On Wed, Apr 29, 2020 at 09:01:29PM +0200, Arnd Bergmann wrote:
> Building with gcc-10 causes a harmless warning, similar to the
> gcc-4.6 warning that Geert fixed last year:
>
> WARNING: modpost: vmlinux.o(.text.unlikely+0xe69): Section mismatch in reference from the function kexec_free_initrd() to the function .init.text:free_initrd_mem()
> The function kexec_free_initrd() references
> the function __init free_initrd_mem().
> This is often because kexec_free_initrd lacks a __init
> annotation or the annotation of free_initrd_mem is wrong.
>
> Add the missing __init annotations.
>
> Fixes: 4ada1e810038 ("initramfs: fix populate_initrd_image() section mismatch")
> Fixes: 23091e287355 ("initramfs: cleanup initrd freeing")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> init/initramfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/init/initramfs.c b/init/initramfs.c
> index 8ec1be4d7d51..bda77a6c8e50 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -542,7 +542,7 @@ void __weak free_initrd_mem(unsigned long start, unsigned long end)
> }
>
> #ifdef CONFIG_KEXEC_CORE
> -static bool kexec_free_initrd(void)
> +static bool __init kexec_free_initrd(void)
> {
> unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
> unsigned long crashk_end = (unsigned long)__va(crashk_res.end);
> @@ -565,7 +565,7 @@ static bool kexec_free_initrd(void)
> return true;
> }
> #else
> -static inline bool kexec_free_initrd(void)
> +static inline bool __init kexec_free_initrd(void)
> {
> return false;
> }
> --
> 2.26.0
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-30 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-29 19:01 [PATCH] initramfs: fix another section mismatch Arnd Bergmann
2020-04-30 8:58 ` Mike Rapoport
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.