Skip to contentSkip to conversation

fix section mismatch warning in lib/swiotlb.c

RFC PATCH In review Sam Ravnborg 2 participants 2 messages Feb 26, 2007 – Feb 27, 2007 Library code

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 fix section mismatch warning in lib/swiotlb.c

kbuild spits outs following warning on a
defconfig x86_64 build:
WARNING: swiotlb.o - Section mismatch: reference to .init.text:swiotlb_init from __ksymtab between '__ksymtab_swiotlb_init' (at offset 0xa0) and '__ksymtab_swiotlb_free_coherent'

This warning happens because the function
swiotlb_init is marked __init and EXPORT_SYMBOL().
A 'git grep swiotlb_init' showed no users in drivers/
so maybe the EXPORT_SYMBOL can be deleted which would cure the warning?

I took the pragmatic approach and made it non-__init.

---

lib/swiotlb.c +2 -2
index 623a68a..3133495 100644
@@ -160,7 +160,7 @@ __setup("swiotlb=", setup_io_tlb_npages);
  * Statically reserve bounce buffer space and initialize bounce buffer data
  * structures for the software IO TLB used to implement the DMA API.
  */
-void __init
+void
 swiotlb_init_with_default_size(size_t default_size)
 {
 	unsigned long i, bytes;
@@ -211,7 +211,7 @@ swiotlb_init_with_default_size(size_t default_size)
 #define __swiotlb_init_with_default_size swiotlb_init_with_default_size
 #endif
 
-void __init
+void
 swiotlb_init(void)
 {
 	__swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */
maintainer
#1 lore raw
Quoted 28 lines · On Mon, 26 Feb 2007 19:38:00 +0100 Sam Ravnborg <[email protected]> wrote:

kbuild spits outs following warning on a
defconfig x86_64 build:
WARNING: swiotlb.o - Section mismatch: reference to .init.text:swiotlb_init from __ksymtab between '__ksymtab_swiotlb_init' (at offset 0xa0) and '__ksymtab_swiotlb_free_coherent'

This warning happens because the function
swiotlb_init is marked __init and EXPORT_SYMBOL().
A 'git grep swiotlb_init' showed no users in drivers/
so maybe the EXPORT_SYMBOL can be deleted which would cure the warning?

I took the pragmatic approach and made it non-__init.

---

lib/swiotlb.c +1 -1
index 623a68a..3133495 100644
@@ -160,7 +160,7 @@ __setup("swiotlb=", setup_io_tlb_npages);
  * Statically reserve bounce buffer space and initialize bounce buffer data
  * structures for the software IO TLB used to implement the DMA API.
  */
-void __init
+void
 swiotlb_init_with_default_size(size_t default_size)
 {
 	unsigned long i, bytes;

lib/swiotlb.c swiotlb_init_with_default_size(size_t default_size) · line 217

Quoted 8 lines
lib/swiotlb.c +1 -1
@@ -211,7 +211,7 @@ swiotlb_init_with_default_size(size_t default_size)
 #define __swiotlb_init_with_default_size swiotlb_init_with_default_size
 #endif
 
-void __init
+void
 swiotlb_init(void)
 {
 	__swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */

eh. If there's a module anywhere which calls swiotlb_init() then I suspect it's one which deserves breaking ;)

I'll remove the export.