diff mbox series

[-next] arm64: gtdt: Fix section mismatch in next_platform_timer()

Message ID 20200508152653.157663-1-wangkefeng.wang@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] arm64: gtdt: Fix section mismatch in next_platform_timer() | expand

Commit Message

Kefeng Wang May 8, 2020, 3:26 p.m. UTC
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.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/acpi/arm64/gtdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hanjun Guo May 9, 2020, 1:18 a.m. UTC | #1
On 2020/5/8 23:26, Kefeng Wang wrote:
> 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.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>   drivers/acpi/arm64/gtdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
> index 01962c63a711..6a327616a299 100644
> --- a/drivers/acpi/arm64/gtdt.c
> +++ b/drivers/acpi/arm64/gtdt.c
> @@ -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
diff mbox series

Patch

diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
index 01962c63a711..6a327616a299 100644
--- a/drivers/acpi/arm64/gtdt.c
+++ b/drivers/acpi/arm64/gtdt.c
@@ -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)
 {