linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] acpi/numa/hmat: fix a section mismatch
@ 2019-11-11 21:34 Qian Cai
  2019-11-12  9:01 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Qian Cai @ 2019-11-11 21:34 UTC (permalink / raw)
  To: rafael.j.wysocki
  Cc: dave.hansen, dan.j.williams, tglx, linux-acpi, linux-kernel, Qian Cai

The commit cf8741ac57ed ("ACPI: NUMA: HMAT: Register "soft reserved"
memory as an "hmem" device") introduced a linker warning,

WARNING: vmlinux.o(.text+0x64ec3c): Section mismatch in reference from
the function hmat_register_target() to the function
.init.text:hmat_register_target_devices()
The function hmat_register_target() references
the function __init hmat_register_target_devices().
This is often because hmat_register_target lacks a __init
annotation or the annotation of hmat_register_target_devices is wrong.

Since hmat_register_target() is also called from hmat_callback(), and
then register_hotmemory_notifier() where it should not be freed when
hmat_init() is done, it indicates the annotation of
hmat_register_target_devices() is incorrect.

Fixes: cf8741ac57ed ("ACPI: NUMA: HMAT: Register "soft reserved" memory as an "hmem" device")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 drivers/acpi/numa/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
index 42cafeaac336..600ae3babd15 100644
--- a/drivers/acpi/numa/hmat.c
+++ b/drivers/acpi/numa/hmat.c
@@ -694,7 +694,7 @@ static void hmat_register_target_device(struct memory_target *target,
 	memregion_free(id);
 }
 
-static __init void hmat_register_target_devices(struct memory_target *target)
+static void hmat_register_target_devices(struct memory_target *target)
 {
 	struct resource *res;
 
-- 
2.21.0 (Apple Git-122.2)


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

* Re: [PATCH -next] acpi/numa/hmat: fix a section mismatch
  2019-11-11 21:34 [PATCH -next] acpi/numa/hmat: fix a section mismatch Qian Cai
@ 2019-11-12  9:01 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2019-11-12  9:01 UTC (permalink / raw)
  To: Qian Cai
  Cc: Rafael Wysocki, Dave Hansen, Dan Williams, Thomas Gleixner,
	ACPI Devel Maling List, Linux Kernel Mailing List

On Mon, Nov 11, 2019 at 10:34 PM Qian Cai <cai@lca.pw> wrote:
>
> The commit cf8741ac57ed ("ACPI: NUMA: HMAT: Register "soft reserved"
> memory as an "hmem" device") introduced a linker warning,
>
> WARNING: vmlinux.o(.text+0x64ec3c): Section mismatch in reference from
> the function hmat_register_target() to the function
> .init.text:hmat_register_target_devices()
> The function hmat_register_target() references
> the function __init hmat_register_target_devices().
> This is often because hmat_register_target lacks a __init
> annotation or the annotation of hmat_register_target_devices is wrong.
>
> Since hmat_register_target() is also called from hmat_callback(), and
> then register_hotmemory_notifier() where it should not be freed when
> hmat_init() is done, it indicates the annotation of
> hmat_register_target_devices() is incorrect.
>
> Fixes: cf8741ac57ed ("ACPI: NUMA: HMAT: Register "soft reserved" memory as an "hmem" device")
> Signed-off-by: Qian Cai <cai@lca.pw>

Applying with minor modifications of the subject and changelog, thanks!

> ---
>  drivers/acpi/numa/hmat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
> index 42cafeaac336..600ae3babd15 100644
> --- a/drivers/acpi/numa/hmat.c
> +++ b/drivers/acpi/numa/hmat.c
> @@ -694,7 +694,7 @@ static void hmat_register_target_device(struct memory_target *target,
>         memregion_free(id);
>  }
>
> -static __init void hmat_register_target_devices(struct memory_target *target)
> +static void hmat_register_target_devices(struct memory_target *target)
>  {
>         struct resource *res;
>
> --
> 2.21.0 (Apple Git-122.2)
>

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

end of thread, other threads:[~2019-11-12  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 21:34 [PATCH -next] acpi/numa/hmat: fix a section mismatch Qian Cai
2019-11-12  9:01 ` Rafael J. Wysocki

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).