Skip to contentSkip to conversation

powerpc/msi: fix section mismatch warning

PATCH Applied Denis Kirjanov 2 participants 2 messages Oct 21, 2015 – Nov 2, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/msi: fix section mismatch warning

Building with CONFIG_DEBUG_SECTION_MISMATCH
gives the following warning:

WARNING: vmlinux.o(.text+0x41fa8): Section mismatch in reference from the function .msi_bitmap_alloc() to the function .init.text:.memblock_virt_alloc_try_nid()
The function .msi_bitmap_alloc() references
the function __init .memblock_virt_alloc_try_nid().
This is often because .msi_bitmap_alloc lacks a __init annotation or the annotation of .memblock_virt_alloc_try_nid is wrong.

memory allocation in msi_bitmap_alloc use either slab allocator or memblock boot-time allocator so that's why we need the __init_refok for the latter case.

---
 arch/powerpc/sysdev/msi_bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/sysdev/msi_bitmap.c +1 -1
index 1a826f3..ed5234e 100644
@@ -112,7 +112,7 @@ int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp)
 	return 0;
 }
 
-int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
+int __init_refok msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
 		     struct device_node *of_node)
 {
 	int size;
Signature · 1 line
2.4.6
reviewer Applied
#1 lore raw
Quoted 11 lines · Denis Kirjanov

Building with CONFIG_DEBUG_SECTION_MISMATCH
gives the following warning:

WARNING: vmlinux.o(.text+0x41fa8): Section mismatch in reference from the function .msi_bitmap_alloc() to the function .init.text:.memblock_virt_alloc_try_nid()
The function .msi_bitmap_alloc() references
the function __init .memblock_virt_alloc_try_nid().
This is often because .msi_bitmap_alloc lacks a __init annotation or the annotation of .memblock_virt_alloc_try_nid is wrong.

Quoted 5 lines

memory allocation in msi_bitmap_alloc use either slab allocator or memblock boot-time allocator so that's why we need the __init_refok for the latter case.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/ccde64b51b33821159d52b09

cheers