public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Section mismatches in drivers/video/console/promcon
@ 2007-06-02 12:42 Sam Ravnborg
  2007-06-02 12:58 ` Jan Engelhardt
  2007-06-02 13:24 ` Antonino A. Daplas
  0 siblings, 2 replies; 7+ messages in thread
From: Sam Ravnborg @ 2007-06-02 12:42 UTC (permalink / raw)
  To: jakub, Jan Engelhardt, daplas; +Cc: LKML

Building a kernel for sparc64 defconfig gave me following warnings:
WARNING: drivers/built-in.o(.text+0xb788): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb790): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb794): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb798): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')

The warnings happens because the function: promcon_init_unimap()
references promfont_unitable and promfont_unicount which are marked
__initdata by the conmakehash command in the drivers/video/console/Makefile

The function promcon_init_unimap() are referenced in two places:
1) In prom_con_init() which is marked __init => no problem.
2) In promcon_init() which is not marked __init => warning.
The actual code is here:
	if (!promcon_uni_pagedir[0] && p) {
		promcon_init_unimap(conp);
	}

I could not from the code judge if promcon_init_unimap is really
only used during early init or this is a bug.
If promcon_init_unimap() is only used during early init it
should be marked __init_refok (with a proper comment)
to silence the warning.

A few people in to: that I hope can help out (thanks to git blame)...

	Sam

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

* Re: Section mismatches in drivers/video/console/promcon
  2007-06-02 12:42 Section mismatches in drivers/video/console/promcon Sam Ravnborg
@ 2007-06-02 12:58 ` Jan Engelhardt
  2007-06-02 13:24 ` Antonino A. Daplas
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2007-06-02 12:58 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: jakub, daplas, LKML


On Jun 2 2007 14:42, Sam Ravnborg wrote:
>
>A few people in to: that I hope can help out (thanks to git blame)...

git needs a "praise" command, like svn. :>


	Jan
-- 

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

* Re: Section mismatches in drivers/video/console/promcon
  2007-06-02 12:42 Section mismatches in drivers/video/console/promcon Sam Ravnborg
  2007-06-02 12:58 ` Jan Engelhardt
@ 2007-06-02 13:24 ` Antonino A. Daplas
  2007-06-02 19:16   ` Sam Ravnborg
  1 sibling, 1 reply; 7+ messages in thread
From: Antonino A. Daplas @ 2007-06-02 13:24 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: jakub, Jan Engelhardt, daplas, LKML

On Sat, 2007-06-02 at 14:42 +0200, Sam Ravnborg wrote:
> Building a kernel for sparc64 defconfig gave me following warnings:
> WARNING: drivers/built-in.o(.text+0xb788): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
> WARNING: drivers/built-in.o(.text+0xb790): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
> WARNING: drivers/built-in.o(.text+0xb794): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
> WARNING: drivers/built-in.o(.text+0xb798): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
> 
> The warnings happens because the function: promcon_init_unimap()
> references promfont_unitable and promfont_unicount which are marked
> __initdata by the conmakehash command in the drivers/video/console/Makefile
> 
> The function promcon_init_unimap() are referenced in two places:
> 1) In prom_con_init() which is marked __init => no problem.
> 2) In promcon_init() which is not marked __init => warning.
> The actual code is here:
> 	if (!promcon_uni_pagedir[0] && p) {
> 		promcon_init_unimap(conp);
> 	}
> 

>  could not from the code judge if promcon_init_unimap is really
> only used during early init or this is a bug.

promcon_init() can be called again from visual_init() during
vc_allocate().  So anything referenced by promcon_init() should not be
marked __init.

Although, if you want to keep promfont_unitable and promfont_unicount
__init, you can probably use con_copy_unimap() using the default vc as
the source instead of doing a promcon_init_unimap() again.

Tony



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

* Re: Section mismatches in drivers/video/console/promcon
  2007-06-02 13:24 ` Antonino A. Daplas
@ 2007-06-02 19:16   ` Sam Ravnborg
  2007-06-05  6:53     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2007-06-02 19:16 UTC (permalink / raw)
  To: Antonino A. Daplas; +Cc: jakub, Jan Engelhardt, daplas, LKML

> 
> promcon_init() can be called again from visual_init() during
> vc_allocate().  So anything referenced by promcon_init() should not be
> marked __init.
> 
> Although, if you want to keep promfont_unitable and promfont_unicount
> __init, you can probably use con_copy_unimap() using the default vc as
> the source instead of doing a promcon_init_unimap() again.

Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please
forward/take care of it.

	Sam

Subject: video: fix section mismatch warning in promcon

Fix the following warnings in promcon:
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x480): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x488): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x48c): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x490): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')

The warnings happens because the function: promcon_init_unimap()
references promfont_unitable and promfont_unicount which are marked
__initdata by the conmakehash command in the drivers/video/console/Makefile

Fix the warning by removing the __initdata marker on the two variables.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
index 9b26dda..ac46cc3 100644
--- a/drivers/video/console/Makefile
+++ b/drivers/video/console/Makefile
@@ -47,7 +47,7 @@ targets := promcon_tbl.c
 quiet_cmd_conmakehash = CNMKHSH $@
       cmd_conmakehash = scripts/conmakehash $< | \
 		sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
-		-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
+		-e 's/dfont\(_uni.*\]\)/promfont\1 /' > $@
 
 $(obj)/promcon_tbl.c: $(src)/prom.uni
 	$(call cmd,conmakehash)


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

* Re: Section mismatches in drivers/video/console/promcon
  2007-06-02 19:16   ` Sam Ravnborg
@ 2007-06-05  6:53     ` David Miller
  2007-06-05  8:05       ` Sam Ravnborg
  2007-06-05 10:52       ` Antonino A. Daplas
  0 siblings, 2 replies; 7+ messages in thread
From: David Miller @ 2007-06-05  6:53 UTC (permalink / raw)
  To: sam; +Cc: adaplas, jakub, jengelh, daplas, linux-kernel

From: Sam Ravnborg <sam@ravnborg.org>
Date: Sat, 2 Jun 2007 21:16:46 +0200

> > 
> > promcon_init() can be called again from visual_init() during
> > vc_allocate().  So anything referenced by promcon_init() should not be
> > marked __init.
> > 
> > Although, if you want to keep promfont_unitable and promfont_unicount
> > __init, you can probably use con_copy_unimap() using the default vc as
> > the source instead of doing a promcon_init_unimap() again.
> 
> Too involved for me to look into.
> I cooked up following very minimal patch - if you agree can you then please
> forward/take care of it.
> 
> 	Sam
> 
> Subject: video: fix section mismatch warning in promcon

I'll merge this fix in via the Sparc tree since this is a sparc
console driver.

Thanks Sam.

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

* Re: Section mismatches in drivers/video/console/promcon
  2007-06-05  6:53     ` David Miller
@ 2007-06-05  8:05       ` Sam Ravnborg
  2007-06-05 10:52       ` Antonino A. Daplas
  1 sibling, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2007-06-05  8:05 UTC (permalink / raw)
  To: David Miller; +Cc: adaplas, jakub, jengelh, daplas, linux-kernel

On Mon, Jun 04, 2007 at 11:53:13PM -0700, David Miller wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Sat, 2 Jun 2007 21:16:46 +0200
> 
> > > 
> > > promcon_init() can be called again from visual_init() during
> > > vc_allocate().  So anything referenced by promcon_init() should not be
> > > marked __init.
> > > 
> > > Although, if you want to keep promfont_unitable and promfont_unicount
> > > __init, you can probably use con_copy_unimap() using the default vc as
> > > the source instead of doing a promcon_init_unimap() again.
> > 
> > Too involved for me to look into.
> > I cooked up following very minimal patch - if you agree can you then please
> > forward/take care of it.
> > 
> > 	Sam
> > 
> > Subject: video: fix section mismatch warning in promcon
> 
> I'll merge this fix in via the Sparc tree since this is a sparc
> console driver.
Thanks. I didn't notice it was sparc only otherwise I would have cc'ed you
and sparclinux.

	Sam

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

* Re: Section mismatches in drivers/video/console/promcon
  2007-06-05  6:53     ` David Miller
  2007-06-05  8:05       ` Sam Ravnborg
@ 2007-06-05 10:52       ` Antonino A. Daplas
  1 sibling, 0 replies; 7+ messages in thread
From: Antonino A. Daplas @ 2007-06-05 10:52 UTC (permalink / raw)
  To: David Miller; +Cc: sam, jakub, jengelh, daplas, linux-kernel

On Mon, 2007-06-04 at 23:53 -0700, David Miller wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Sat, 2 Jun 2007 21:16:46 +0200
> 
> > > 
> > > promcon_init() can be called again from visual_init() during
> > > vc_allocate().  So anything referenced by promcon_init() should not be
> > > marked __init.
> > > 
> > > Although, if you want to keep promfont_unitable and promfont_unicount
> > > __init, you can probably use con_copy_unimap() using the default vc as
> > > the source instead of doing a promcon_init_unimap() again.
> > 
> > Too involved for me to look into.
> > I cooked up following very minimal patch - if you agree can you then please
> > forward/take care of it.
> > 
> > 	Sam
> > 
> > Subject: video: fix section mismatch warning in promcon
> 
> I'll merge this fix in via the Sparc tree since this is a sparc
> console driver.
> 

I was about to send this patch to akpm, I'll leave this to you then.

Tony



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

end of thread, other threads:[~2007-06-05 11:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-02 12:42 Section mismatches in drivers/video/console/promcon Sam Ravnborg
2007-06-02 12:58 ` Jan Engelhardt
2007-06-02 13:24 ` Antonino A. Daplas
2007-06-02 19:16   ` Sam Ravnborg
2007-06-05  6:53     ` David Miller
2007-06-05  8:05       ` Sam Ravnborg
2007-06-05 10:52       ` Antonino A. Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox