watchdog: fix nv_tco section mismatch
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;
Quoted 4 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix section mismatch warning:
Mark the callednv_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?
Quoted 11 lines · Mike Waychison
Quoted 4 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix section mismatch warning:
Mark the callednv_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
__initand__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 ***