Skip to contentSkip to conversation

ARM: omap2: remove incorrect __init annotation

PATCH Applied Arnd Bergmann 3 participants 3 messages Jun 19, 2019

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

PATCH 1/1 ARM: omap2: remove incorrect __init annotation

omap3xxx_prm_enable_io_wakeup() is marked __init, but its caller is not, so we get a warning with clang-8:

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

When building with gcc, omap3xxx_prm_enable_io_wakeup() is always inlined, so we never noticed in the past.

---
 arch/arm/mach-omap2/prm3xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/prm3xxx.c +1 -1
index 05858f966f7d..dfa65fc2c82b 100644
@@ -433,7 +433,7 @@ static void omap3_prm_reconfigure_io_chain(void)
  * registers, and omap3xxx_prm_reconfigure_io_chain() must be called.
  * No return value.
  */
-static void __init omap3xxx_prm_enable_io_wakeup(void)
+static void omap3xxx_prm_enable_io_wakeup(void)
 {
 	if (prm_features & PRM_HAS_IO_WAKEUP)
 		omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
Signature · 1 line
2.20.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

omap3xxx_prm_enable_io_wakeup() is marked __init, but its caller is not, so we get a warning with clang-8:

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

That's unfortunate, both omap3xxx_prm_enable_io_wakeup and omap3xxx_prm_late_init are only ever called at init time (by prm_late_init which is also __init annotated). However the omap3xxx_prm_ll_data structure containing the late_init has a life beyond init. Otherwise I would have suggested annotating omap3xxx_prm_late_init.

Quoted 31 lines

When building with gcc, omap3xxx_prm_enable_io_wakeup() is always inlined, so we never noticed in the past.

---
 arch/arm/mach-omap2/prm3xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/prm3xxx.c +1 -1
index 05858f966f7d..dfa65fc2c82b 100644
@@ -433,7 +433,7 @@ static void omap3_prm_reconfigure_io_chain(void)
  * registers, and omap3xxx_prm_reconfigure_io_chain() must be called.
  * No return value.
  */
-static void __init omap3xxx_prm_enable_io_wakeup(void)
+static void omap3xxx_prm_enable_io_wakeup(void)
 {
 	if (prm_features & PRM_HAS_IO_WAKEUP)
 		omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
Signature · 7 lines
2.20.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

omap3xxx_prm_enable_io_wakeup() is marked __init, but its caller is not, so we get a warning with clang-8:

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

Quoted 6 lines

When building with gcc, omap3xxx_prm_enable_io_wakeup() is always inlined, so we never noticed in the past.

Applied to fixes. Thanks!

-Olof