Skip to contentSkip to conversation

fix sparc32 modpost warnings

PATCH In review Martin Habets 2 participants 3 messages Oct 10, 2006 – Oct 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 fix sparc32 modpost warnings

Fix this 2.6.19-rc1 build warnings from modpost:

WARNING: vmlinux - Section mismatch: reference to .init.text:sunzilog_console_setup from .data between 'sunzilog_console' (at offset 0x8394) and 'devices_subsys'

Martin

---
Index: linux/drivers/serial/sunzilog.c
=================================--- linux.orig/drivers/serial/sunzilog.c 2006-10-06 00:33:43.000000000 +0100
+++ linux/drivers/serial/sunzilog.c 2006-10-07 03:48:41.000000000 +0100
@@ -1190,7 +1190,7 @@
return 0;
}

-static struct console sunzilog_console = {
+static struct console sunzilog_console_ops = {
.name = "ttyS",
.write = sunzilog_console_write,
.device = uart_console_device,
@@ -1216,10 +1216,10 @@
if (i = NUM_CHANNELS)
return NULL;

- sunzilog_console.index = i;
+ sunzilog_console_ops.index = i;
sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS;

- return &sunzilog_console;
+ return &sunzilog_console_ops;
}

#else

#1 lore raw

From: Martin Habets <[email protected]>
Date: Tue, 10 Oct 2006 16:46:35 +0100

Quoted 5 lines

Fix this 2.6.19-rc1 build warnings from modpost:

WARNING: vmlinux - Section mismatch: reference to .init.text:sunzilog_console_setup from .data between 'sunzilog_console' (at offset 0x8394) and 'devices_subsys'

...

Review

Quoted 2 lines
(quoted diff) +1 -1
-static struct console sunzilog_console = {
+static struct console sunzilog_console_ops = {

I'll apply this, but why does simply changing the symbol name make the section conflict go away?

#2 lore raw
In reply to Martin Habets
Quoted 7 lines · David Miller

From: Martin Habets <[email protected]>
Date: Tue, 10 Oct 2006 16:46:35 +0100

Quoted 4 lines

Fix this 2.6.19-rc1 build warnings from modpost:

WARNING: vmlinux - Section mismatch: reference to .init.text:sunzilog_console_setup from .data between 'sunzilog_console' (at offset 0x8394) and 'devices_subsys'

Quoted 7 lines
Quoted 1 line

...

Review

Quoted 2 lines
(quoted diff) +1 -1
-static struct console sunzilog_console = {
+static struct console sunzilog_console_ops = {

I'll apply this, but why does simply changing the symbol name make the section conflict go away?

Ok, I'll be more verbose in future. This patch works because modpost has a couple of patterns built-in that it ignores. I could have picked any pattern listed below, but felt _ops was the most apropriate one here.

From the comments for secref_whitelist():
* Pattern 2:

 *   Many drivers utilise a *driver container with references to
 *   add, remove, probe functions etc.
 *   These functions may often be marked __init and we do not want to
 *   warn here.
 *   the pattern is identified by:
 *   tosec   = .init.text | .exit.text | .init.data
 *   fromsec = .data
 *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one

More on the other patches later.

Thanks,

Signature · 1 line
Martin