Skip to contentSkip to conversation

Move omap_timer to the initdata section.

PATCH In review Vivien Chappelier 2 participants 3 messages Jun 9, 2007

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

PATCH 12/12 Move omap_timer to the initdata section.

This patch fixes a warning due to omap_timer not belonging to the __initdata section as it should.

---
 arch/arm/mach-omap1/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap1/time.c +1 -1
index 3705d20..0ba739c 100644
@@ -289,6 +289,6 @@ static void __init omap_timer_init(void)
 	omap_init_clocksource(rate);
 }
 
-struct sys_timer omap_timer = {
+struct sys_timer omap_timer __initdata = {
 	.init		= omap_timer_init,
 };
Signature · 1 line
1.5.1.3
#1 lore raw

Hi,

Quoted 22 lines · Vivien Chappelier

This patch fixes a warning due to omap_timer not belonging to the __initdata section as it should.

---
 arch/arm/mach-omap1/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap1/time.c +1 -2
index 3705d20..0ba739c 100644
@@ -289,6 +289,6 @@ static void __init omap_timer_init(void)
        omap_init_clocksource(rate);
 }
 
-struct sys_timer omap_timer = {
+struct sys_timer omap_timer __initdata = {
        .init           = omap_timer_init,
 };
--
Quoted 1 line

1.5.1.3

This was already proposed a couple of times (for example here:
http://linux.omap.com/pipermail/linux-omap-open-source/2007-May/010075.html)
but it is wrong because omap_timer is used a lot after initdata is discarded. One possible solution is leaving .init uninitialised, and assigning it somewhere during the arch initialisation, with something like:

   omap_timer.init = omap_timer_init;

But maybe it's better to just ignore the reference to another section, as Tony suggested.

#2 lore raw

Hi,

Quoted 30 lines · andrzej zaborowski

Hi,

Quoted 23 lines · Vivien Chappelier

This patch fixes a warning due to omap_timer not belonging to the __initdata section as it should.

---
 arch/arm/mach-omap1/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap1/time.c +1 -1
index 3705d20..0ba739c 100644
@@ -289,6 +289,6 @@ static void __init omap_timer_init(void)
        omap_init_clocksource(rate);
 }
 
-struct sys_timer omap_timer = {
+struct sys_timer omap_timer __initdata = {
        .init           = omap_timer_init,
 };
Signature · 1 line
1.5.1.3

This was already proposed a couple of times (for example here:
http://linux.omap.com/pipermail/linux-omap-open-source/2007-May/010075.html)

Quoted 2 lines

but it is wrong because omap_timer is used a lot after initdata is discarded.

This is indeed wrong, seems I got (un)lucky at runtime.. Since there is no current way of saying omap_timer.init won't be used after the .init.* sections are discared, I agree that we should remove the warning for that specific case. But we still lose 4 bytes for a pointer that could be discarded :-)

Quoted 5 lines

One possible solution is leaving .init uninitialised, and assigning it somewhere during the arch initialisation, with something like:

   omap_timer.init = omap_timer_init;

Well, I don't quite like the fact that those warnings are removed based on variable names only (as explained here http://www.mail-archive.com/[email protected]/msg155753.html), so this might be an alternative to consider.

Thanks for pointing out the issue,
Vivien.