Skip to contentSkip to conversation

modpost: relax driver data name

PATCH In review Randy.Dunlap 3 participants 5 messages Apr 15, 2006 – Apr 16, 2006

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

PATCH 1/1 modpost: relax driver data name

From: Randy Dunlap <[email protected]>

modpost: Relax driver data name from *_driver to *driver. This fixes the 26 section mismatch warnings in drivers/ide/pci.

---
 scripts/mod/modpost.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
scripts/mod/modpost.c +3 -3
@@ -487,14 +487,14 @@ static int strrcmp(const char *s, const 
  *   atsym   =__param*
  *
  * Pattern 2:
- *   Many drivers utilise a *_driver container with references to
+ *   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
+ *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
  **/
 static int secref_whitelist(const char *tosec, const char *fromsec,
 			    const char *atsym)
@@ -502,7 +502,7 @@ static int secref_whitelist(const char *
 	int f1 = 1, f2 = 1;
 	const char **s;
 	const char *pat2sym[] = {
-		"_driver",
+		"driver",
 		"_template", /* scsi uses *_template a lot */
 		"_sht",      /* scsi also used *_sht to some extent */
 		"_ops",

---

#1 lore raw

modpost: serial/8250_pci warnings

drivers/serial/8250_pci.o has 23 section mismatch warnings. They are all related to (come from) this struct:

static struct pci_serial_quirk pci_serial_quirks[] = {

so maybe either "quirk" can go into the whitelist, or Russell can tell us if these are false positives or need to be fixed.

---
~Randy

#2 lore raw

Re: modpost: serial/8250_pci warnings

Quoted 9 lines · Randy.Dunlap

drivers/serial/8250_pci.o has 23 section mismatch warnings. They are all related to (come from) this struct:

static struct pci_serial_quirk pci_serial_quirks[] = {

so maybe either "quirk" can go into the whitelist, or Russell can tell us if these are false positives or need to be fixed.

.init is referenced from pciserial_init_ports() which is NOT marked __devinit.
And pciserial_init_ports() is exported - so it cannot be marked __devinit => it is a bug.

Sam

#3 lore raw

Re: modpost: serial/8250_pci warnings

Quoted 7 lines · Sam Ravnborg
Quoted 6 lines · Randy.Dunlap

drivers/serial/8250_pci.o has 23 section mismatch warnings. They are all related to (come from) this struct:

static struct pci_serial_quirk pci_serial_quirks[] = {

Quoted 7 lines
Quoted 3 lines

so maybe either "quirk" can go into the whitelist, or Russell can tell us if these are false positives or need to be fixed.

.init is referenced from pciserial_init_ports() which is NOT marked __devinit.
And pciserial_init_ports() is exported - so it cannot be marked __devinit => it is a bug.

Out of the seven functions marked __devinit, only one is actually buggy, since only Netmos make both serial as well as serial and parallel cards.

A problem will only occur if parport_serial registers a Netmos port and the netmos quirk is marked as __devinit. The other quirks never match any parallel port devices, and so will never be called.

Splitting the quirk table into parport_serial doesn't resolve this issue as far as static analysis goes either.

A better solution would be to fix the device model so that devices can have more than one driver, so parport_serial doesn't have to exist.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#4 lore raw
In reply to Randy.Dunlap
Quoted 4 lines · Randy.Dunlap

From: Randy Dunlap <[email protected]>

modpost: Relax driver data name from *_driver to *driver. This fixes the 26 section mismatch warnings in drivers/ide/pci.

For an allmodconfig build with CONFIG_HOTPLUG=n this killed 118 warnings out of 245 warnings in total. Applied.

To turn off CONFIG_HOTPLUG I simply changed the Kconfig files like this:

drivers/base/Kconfig +0 -1
index f0eff3d..1e25fc2 100644
@@ -20,7 +20,6 @@ config PREVENT_FIRMWARE_BUILD
 
 config FW_LOADER
 	tristate "Userspace firmware loading support"
-	select HOTPLUG
 	---help---
 	  This option is provided for the case where no in-kernel-tree modules
 	  require userspace firmware loading support, but a module built outside

Then it became trivial to turn off CONFIG_HOTPLUG.

Sam