Skip to contentSkip to conversation

clocksource: integrator: fix section mismatch warning

PATCH In review Arnd Bergmann 3 participants 3 messages Sep 15, 2017 – Sep 21, 2017 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: integrator: fix section mismatch warning

gcc-4.6 and older fail to inline integrator_clocksource_init, so they end up showing a harmless warning:

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

This adds the missing __init annotation that makes it build cleanly with all compilers.

---
 drivers/clocksource/timer-integrator-ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/timer-integrator-ap.c +2 -2
index 2ff64d9d4fb3..62d24690ba02 100644
@@ -36,8 +36,8 @@ static u64 notrace integrator_read_sched_clock(void)
 	return -readl(sched_clk_base + TIMER_VALUE);
 }
 
-static int integrator_clocksource_init(unsigned long inrate,
-				       void __iomem *base)
+static int __init integrator_clocksource_init(unsigned long inrate,
+					      void __iomem *base)
 {
 	u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
 	unsigned long rate = inrate;
Signature · 1 line
2.9.0
#1 lore raw

[tip:timers/urgent] clocksource/integrator: Fix section mismatch warning

clocksource/integrator: Fix section mismatch warning
Commit-ID:  8fce3dc5c5d6f6301f67311fa79f333902b58cea
Gitweb:     http://git.kernel.org/tip/8fce3dc5c5d6f6301f67311fa79f333902b58cea
Author:     Arnd Bergmann <[email protected]>
AuthorDate: Fri, 15 Sep 2017 21:42:59 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 18 Sep 2017 09:37:33 +0200

clocksource/integrator: Fix section mismatch warning

gcc-4.6 and older fail to inline integrator_clocksource_init, so they end up showing a harmless warning:

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

Add the missing __init annotation that makes it build cleanly with all compilers.

---
 drivers/clocksource/timer-integrator-ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/timer-integrator-ap.c +2 -2
index 2ff64d9..62d2469 100644
@@ -36,8 +36,8 @@ static u64 notrace integrator_read_sched_clock(void)
 	return -readl(sched_clk_base + TIMER_VALUE);
 }
 
-static int integrator_clocksource_init(unsigned long inrate,
-				       void __iomem *base)
+static int __init integrator_clocksource_init(unsigned long inrate,
+					      void __iomem *base)
 {
 	u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
 	unsigned long rate = inrate;
Acked-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

gcc-4.6 and older fail to inline integrator_clocksource_init, so they end up showing a harmless warning:

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

Quoted 4 lines

This adds the missing __init annotation that makes it build cleanly with all compilers.

I guess Daniel will pick this up.

Yours,
Linus Walleij