Skip to contentSkip to conversation

ACPI: s2idle: fix section mismatch warning

PATCH Applied Arnd Bergmann 2 participants 2 messages Jun 1, 2023 – Jun 5, 2023 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: s2idle: fix section mismatch warning

From: Arnd Bergmann <[email protected]>

The acpi_sleep_suspend_setup() function is missing an __init annotation, which causes a warning in rare configurations that end up not inlining it into its caller:

WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_sleep_suspend_setup (section: .text) -> acpi_s2idle_setup (section: .init.text)

It's only called from an __init function, so adding the annotation is correct here.

---
 drivers/acpi/sleep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sleep.c +1 -1
index 72470b9f16c45..552adc04743b5 100644
@@ -840,7 +840,7 @@ void __weak acpi_s2idle_setup(void)
 	s2idle_set_ops(&acpi_s2idle_ops);
 }
 
-static void acpi_sleep_suspend_setup(void)
+static void __init acpi_sleep_suspend_setup(void)
 {
 	bool suspend_ops_needed = false;
 	int i;
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 22 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The acpi_sleep_suspend_setup() function is missing an __init annotation, which causes a warning in rare configurations that end up not inlining it into its caller:

WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_sleep_suspend_setup (section: .text) -> acpi_s2idle_setup (section: .init.text)

It's only called from an __init function, so adding the annotation is correct here.

---
 drivers/acpi/sleep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sleep.c +0 -0
index 72470b9f16c45..552adc04743b5 100644

drivers/acpi/sleep.c void __weak acpi_s2idle_setup(void)

Quoted 9 lines
drivers/acpi/sleep.c +1 -2
@@ -840,7 +840,7 @@ void __weak acpi_s2idle_setup(void)
        s2idle_set_ops(&acpi_s2idle_ops);
 }
 
-static void acpi_sleep_suspend_setup(void)
+static void __init acpi_sleep_suspend_setup(void)
 {
        bool suspend_ops_needed = false;
        int i;
--

Applied as 6.5 material, thanks!