linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] powerpc/msi: fix section mismatch warning
@ 2015-10-21 11:29 Denis Kirjanov
  2015-11-02  9:41 ` [v2] " Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Kirjanov @ 2015-10-21 11:29 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Stephen Rothwell, linuxppc-dev, 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.

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.

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
---
 arch/powerpc/sysdev/msi_bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 1a826f3..ed5234e 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -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;
-- 
2.4.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [v2] powerpc/msi: fix section mismatch warning
  2015-10-21 11:29 [PATCH v2] powerpc/msi: fix section mismatch warning Denis Kirjanov
@ 2015-11-02  9:41 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2015-11-02  9:41 UTC (permalink / raw)
  To: Denis Kirjanov; +Cc: Stephen Rothwell, Denis Kirjanov, linuxppc-dev

On Wed, 2015-21-10 at 11:29:13 UTC, Denis Kirjanov wrote:
> 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.
> 
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>

Applied to powerpc next, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-02  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 11:29 [PATCH v2] powerpc/msi: fix section mismatch warning Denis Kirjanov
2015-11-02  9:41 ` [v2] " Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).