Skip to contentSkip to conversation

alpha: remove __init annotation from exported page_is_ram()

PATCH In review Masahiro Yamada 2 participants 2 messages Jul 29, 2023 – Jul 30, 2023

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

PATCH 1/1 alpha: remove __init annotation from exported page_is_ram()

EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization.

Commit c5a130325f13 ("ACPI/APEI: Add parameter check before error injection") exported page_is_ram(), hence the __init annotation should be removed.

This fixes the modpost warning in ARCH=alpha builds:

WARNING: modpost: vmlinux: page_is_ram: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.

Fixes c5a130325f13 ("ACPI/APEI: Add parameter check before error injection")

---

 arch/alpha/kernel/setup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/alpha/kernel/setup.c +1 -2
index b650ff1cb022..3d7473531ab1 100644
@@ -385,8 +385,7 @@ setup_memory(void *kernel_end)
 #endif /* CONFIG_BLK_DEV_INITRD */
 }
 
-int __init
-page_is_ram(unsigned long pfn)
+int page_is_ram(unsigned long pfn)
 {
 	struct memclust_struct * cluster;
 	struct memdesc_struct * memdesc;
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Masahiro Yamada

EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization.

Commit c5a130325f13 ("ACPI/APEI: Add parameter check before error injection") exported page_is_ram(), hence the __init annotation should be removed.

Quoted 6 lines

This fixes the modpost warning in ARCH=alpha builds:

WARNING: modpost: vmlinux: page_is_ram: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.

Fixes c5a130325f13 ("ACPI/APEI: Add parameter check before error injection")

Thanks.

Quoted 19 lines

---

 arch/alpha/kernel/setup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/alpha/kernel/setup.c +1 -2
index b650ff1cb022..3d7473531ab1 100644
@@ -385,8 +385,7 @@ setup_memory(void *kernel_end)
 #endif /* CONFIG_BLK_DEV_INITRD */
 }
 
-int __init
-page_is_ram(unsigned long pfn)
+int page_is_ram(unsigned long pfn)
 {
 	struct memclust_struct * cluster;
 	struct memdesc_struct * memdesc;
Signature · 1 line
~Randy