Skip to contentSkip to conversation

watchdog: fix nv_tco section mismatch

PATCH In review Randy Dunlap 2 participants 3 messages Mar 24, 2011 – Mar 26, 2011 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: fix nv_tco section mismatch

From: Randy Dunlap <[email protected]>

Fix section mismatch warning:
Mark the called nv_tco_getdevice() as __devinit, just like its caller.

WARNING: drivers/watchdog/nv_tco.o(.devinit.text+0x16): Section mismatch in reference from the function nv_tco_init() to the function .init.text:nv_tco_getdevice() The function __devinit nv_tco_init() references
a function __init nv_tco_getdevice().
If nv_tco_getdevice is only used by nv_tco_init then
annotate nv_tco_getdevice with a matching annotation.

---
 drivers/watchdog/nv_tco.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/nv_tco.c +1 -1
@@ -302,7 +302,7 @@ MODULE_DEVICE_TABLE(pci, tco_pci_tbl);
  *	Init & exit routines
  */
 
-static unsigned char __init nv_tco_getdevice(void)
+static unsigned char __devinit nv_tco_getdevice(void)
 {
 	struct pci_dev *dev = NULL;
 	u32 val;
#1 lore raw
Quoted 4 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Fix section mismatch warning:
Mark the called nv_tco_getdevice() as __devinit, just like its caller.

This looks fine.

I can't seem to reproduce the warning on my end however, compiling this as a built-in nor as a module. How do I trigger a difference between __init and __devinit?

#2 lore raw
Quoted 11 lines · Mike Waychison
Quoted 4 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Fix section mismatch warning:
Mark the called nv_tco_getdevice() as __devinit, just like its caller.

This looks fine.

I can't seem to reproduce the warning on my end however, compiling this as a built-in nor as a module. How do I trigger a difference between __init and __devinit?

I just used allmodconfig. But why wouldn't you see a differnence between __init and __devinit? They are defined differently in include/linux/init.h, but maybe on some $arch, those sections are treated differently?

I dunno.

Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***