Skip to contentSkip to conversation

megaraid_mbox: fix section mismatch warnings

PATCH In review Randy.Dunlap 2 participants 3 messages May 25, 2006

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

PATCH 1/1 megaraid_mbox: fix section mismatch warnings

From: Randy Dunlap <[email protected]>

Fix section warning:
WARNING: drivers/scsi/megaraid/megaraid_mbox.o - Section mismatch: reference to .init.text: from .text between 'megaraid_probe_one' (at offset 0x171e) and 'megaraid_queue_command'

---
 drivers/scsi/megaraid/megaraid_mbox.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_mbox.c +1 -1
@@ -714,7 +714,7 @@ megaraid_io_detach(adapter_t *adapter)
  * . Allocate memory required for all the commands
  * . Use internal library of FW routines, build up complete soft state
  */
-static int __init
+static int __devinit
 megaraid_init_mbox(adapter_t *adapter)
 {
 	struct pci_dev		*pdev;

---

#1 lore raw
Quoted 16 lines · Randy.Dunlap

From: Randy Dunlap <[email protected]>

Fix section warning:
WARNING: drivers/scsi/megaraid/megaraid_mbox.o - Section mismatch: reference to .init.text: from .text between 'megaraid_probe_one' (at offset 0x171e) and 'megaraid_queue_command'

---
 drivers/scsi/megaraid/megaraid_mbox.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

drivers/scsi/megaraid/megaraid_mbox.c megaraid_io_detach(adapter_t *adapter) · line 720

Quoted 8 lines
drivers/scsi/megaraid/megaraid_mbox.c +1 -1
@@ -714,7 +714,7 @@ megaraid_io_detach(adapter_t *adapter)
  * . Allocate memory required for all the commands
  * . Use internal library of FW routines, build up complete soft state
  */
-static int __init
+static int __devinit
 megaraid_init_mbox(adapter_t *adapter)
 {
 	struct pci_dev		*pdev;

<trying to get the old brain sorted out here>

This one's a bugfix, isn't it? In the CONFIG_HOTPLUG kernel the __devinit megaraid_probe_one() resides in .text and calls the __init megaraid_init_mbox(), which isn't there any more. So if this driver is statically linked into vmlinux and the kernel is hotplug-capable and if someone hotplugs one of these devices we go blam.

You agree with that analysis?

If so, I'll toss this onto the 2.6.17 pile, thanks.

#2 lore raw
Quoted 34 lines · On Thu, 25 May 2006 14:39:50 -0700 Andrew Morton wrote:
Quoted 16 lines · Randy.Dunlap

From: Randy Dunlap <[email protected]>

Fix section warning:
WARNING: drivers/scsi/megaraid/megaraid_mbox.o - Section mismatch: reference to .init.text: from .text between 'megaraid_probe_one' (at offset 0x171e) and 'megaraid_queue_command'

---
 drivers/scsi/megaraid/megaraid_mbox.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

drivers/scsi/megaraid/megaraid_mbox.c megaraid_io_detach(adapter_t *adapter) · line 720

Quoted 8 lines
drivers/scsi/megaraid/megaraid_mbox.c +1 -1
@@ -714,7 +714,7 @@ megaraid_io_detach(adapter_t *adapter)
  * . Allocate memory required for all the commands
  * . Use internal library of FW routines, build up complete soft state
  */
-static int __init
+static int __devinit
 megaraid_init_mbox(adapter_t *adapter)
 {
 	struct pci_dev		*pdev;

<trying to get the old brain sorted out here>

This one's a bugfix, isn't it? In the CONFIG_HOTPLUG kernel the __devinit megaraid_probe_one() resides in .text and calls the __init megaraid_init_mbox(), which isn't there any more. So if this driver is statically linked into vmlinux and the kernel is hotplug-capable and if someone hotplugs one of these devices we go blam.

Quoted 3 lines

You agree with that analysis?

If so, I'll toss this onto the 2.6.17 pile, thanks.

Yes, agreed.

Thanks,
---
~Randy