Skip to contentSkip to conversation

kho: fix kho_test_restore section mismatch warning

PATCH In review Arnd Bergmann 2 participants 2 messages Jul 31, 2025

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

PATCH 1/1 kho: fix kho_test_restore section mismatch warning

From: Arnd Bergmann <[email protected]>

kho_test_restore_data() is not always inlined, and that configuration causes a link warning:

WARNING: modpost: vmlinux: section mismatch in reference: kho_test_restore+0xd2 (section: .text.unlikely) -> kho_test_restore_data.isra.0 (section: .init.text)
ERROR: modpost: Section mismatches detected.

Mark it __init as well to be consistent with the rest of the call chain.

Fixes c2d288f7ab13 ("kho: add test for kexec handover")
---
 lib/test_kho.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_kho.c +1 -1
index f5fe39c7c2b1..aeeb693d0251 100644
@@ -239,7 +239,7 @@ static int __init kho_test_restore_data(const void *fdt, int node)
 	return 0;
 }
 
-static int kho_test_restore(phys_addr_t fdt_phys)
+static int __init kho_test_restore(phys_addr_t fdt_phys)
 {
 	void *fdt = phys_to_virt(fdt_phys);
 	const unsigned int *magic;
Signature · 1 line
2.39.5
maintainer
#1 lore raw

Hi Arnd,

Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

kho_test_restore_data() is not always inlined, and that configuration causes a link warning:

WARNING: modpost: vmlinux: section mismatch in reference: kho_test_restore+0xd2 (section: .text.unlikely) -> kho_test_restore_data.isra.0 (section: .init.text)
ERROR: modpost: Section mismatches detected.

Mark it __init as well to be consistent with the rest of the call chain.

I've already sent a fix:

https://lore.kernel.org/all/[email protected]/

and Andrew picked it up.

Quoted 22 lines
Fixes c2d288f7ab13 ("kho: add test for kexec handover")
---
 lib/test_kho.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_kho.c +1 -1
index f5fe39c7c2b1..aeeb693d0251 100644
@@ -239,7 +239,7 @@ static int __init kho_test_restore_data(const void *fdt, int node)
 	return 0;
 }
 
-static int kho_test_restore(phys_addr_t fdt_phys)
+static int __init kho_test_restore(phys_addr_t fdt_phys)
 {
 	void *fdt = phys_to_virt(fdt_phys);
 	const unsigned int *magic;
Signature · 1 line
2.39.5
Signature · 2 lines
Sincerely yours,
Mike.