Skip to contentSkip to conversation

arm64: gtdt: Fix section mismatch in next_platform_timer()

PATCH In review Kefeng Wang 2 participants 2 messages May 8, 2020 – May 9, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: gtdt: Fix section mismatch in next_platform_timer()

Drop the __initdata for acpi_gtdt_desc variable to fix the section mismatch,

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

---
 drivers/acpi/arm64/gtdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +1 -1
index 01962c63a711..6a327616a299 100644
@@ -34,7 +34,7 @@ struct acpi_gtdt_descriptor {
 	void *platform_timer;
 };
 
-static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
+static struct acpi_gtdt_descriptor acpi_gtdt_desc;
 
 static inline void *next_platform_timer(void *platform_timer)
 {
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 19 lines · Kefeng Wang

Drop the __initdata for acpi_gtdt_desc variable to fix the section mismatch,

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

---
  drivers/acpi/arm64/gtdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +0 -0
index 01962c63a711..6a327616a299 100644

drivers/acpi/arm64/gtdt.c struct acpi_gtdt_descriptor { · line 39

Quoted 7 lines
drivers/acpi/arm64/gtdt.c +1 -1
@@ -34,7 +34,7 @@ struct acpi_gtdt_descriptor {
  	void *platform_timer;
  };
 
-static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
+static struct acpi_gtdt_descriptor acpi_gtdt_desc;
 
  static inline void *next_platform_timer(void *platform_timer)

I prefer to make this function as no inline, and make it as __init function, becasue acpi_gtdt_desc is not used after gtdt_sbsa_gwdt_init().

Thanks
Hanjun