hwmon: Fix spurious section mismatch warning in sht15.c
PATCH 1/1 hwmon: Fix spurious section mismatch warning in sht15.c
Fix spurious section mismatch warnings, caused due to reference from variable sht_drivers to
__devinit/__devexit functions sht15_probe()/remove().
We were warned by the following warnings:
LD drivers/hwmon/built-in.o
WARNING: drivers/hwmon/built-in.o(.data+0x264a0): Section mismatch in reference from the variable sht_drivers to the function .devinit.text:sht15_probe()
The variable sht_drivers references
the function __devinit sht15_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
WARNING: drivers/hwmon/built-in.o(.data+0x264a4): Section mismatch in reference from the variable sht_drivers to the function .devexit.text:sht15_remove()
The variable sht_drivers references
the function __devexit sht15_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
WARNING: drivers/hwmon/built-in.o(.data+0x264f0): Section mismatch in reference from the variable sht_drivers to the function .devinit.text:sht15_probe()
The variable sht_drivers references
the function __devinit sht15_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
WARNING: drivers/hwmon/built-in.o(.data+0x264f4): Section mismatch in reference from the variable sht_drivers to the function .devexit.text:sht15_remove()
The variable sht_drivers references
the function __devexit sht15_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
WARNING: drivers/hwmon/built-in.o(.data+0x26540): Section mismatch in reference from the variable sht_drivers to the function .devinit.text:sht15_probe()
The variable sht_drivers references
the function __devinit sht15_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
WARNING: drivers/hwmon/built-in.o(.data+0x26544): Section mismatch in reference from the variable sht_drivers to the function .devexit.text:sht15_remove()
The variable sht_drivers references
the function __devexit sht15_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
WARNING: drivers/hwmon/built-in.o(.data+0x26590): Section mismatch in reference from the variable sht_drivers to the function .devinit.text:sht15_probe()
The variable sht_drivers references
the function __devinit sht15_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
-------
drivers/hwmon/sht15.c +6 -2
@@ -619,8 +619,12 @@ static int __devexit sht15_remove(structreturn 0 ; } - -static struct platform_driver sht_drivers[] = { +/* +* sht_drivers simultaneously refers to __devinit and __devexit function +* which causes spurious section mismatch warning. So use __refdata to +* get rid from this. +*/ +static struct platform_driver __refdata sht_drivers[] = { { .driver = { .name ="sht10" ,
Hi Rabik,
Quoted 80 lines · Rakib Mullick
Fix spurious section mismatch warnings, caused due to reference from variable
sht_driversto
__devinit/__devexit functions sht15_probe()/remove().We were warned by the following warnings:
LD
drivers/hwmon/built-in.o
WARNING: drivers/hwmon/built-in.o(.data+0x264a0): Section mismatch in reference from the variablesht_driversto the function .devinit.text:sht15_probe()
The variablesht_driversreferences
the function__devinitsht15_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,WARNING: drivers/hwmon/built-in.o(.data+0x264a4): Section mismatch in reference from the variable
sht_driversto the function .devexit.text:sht15_remove()
The variablesht_driversreferences
the function__devexitsht15_remove()
If the reference is valid then annotate the
variable with __exit* (seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,WARNING: drivers/hwmon/built-in.o(.data+0x264f0): Section mismatch in reference from the variable
sht_driversto the function .devinit.text:sht15_probe()
The variablesht_driversreferences
the function__devinitsht15_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,WARNING: drivers/hwmon/built-in.o(.data+0x264f4): Section mismatch in reference from the variable
sht_driversto the function .devexit.text:sht15_remove()
The variablesht_driversreferences
the function__devexitsht15_remove()
If the reference is valid then annotate the
variable with __exit* (seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,WARNING: drivers/hwmon/built-in.o(.data+0x26540): Section mismatch in reference from the variable
sht_driversto the function .devinit.text:sht15_probe()
The variablesht_driversreferences
the function__devinitsht15_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,WARNING: drivers/hwmon/built-in.o(.data+0x26544): Section mismatch in reference from the variable
sht_driversto the function .devexit.text:sht15_remove()
The variablesht_driversreferences
the function__devexitsht15_remove()
If the reference is valid then annotate the
variable with __exit* (seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,WARNING: drivers/hwmon/built-in.o(.data+0x26590): Section mismatch in reference from the variable
sht_driversto the function .devinit.text:sht15_probe()
The variablesht_driversreferences
the function__devinitsht15_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console,-------
Signed-off-by Rakib Mullick <[email protected]>drivers/hwmon/sht15.c +0
-1@@ -619,8 +619,12 @@ static int __devexit sht15_remove(structreturn 0 ; } -
drivers/hwmon/sht15.c static int __devexit sht15_remove(struct · line 630
Quoted 10 lines
drivers/hwmon/sht15.c +6
-1-static struct platform_driver sht_drivers[] = { +/* +* sht_drivers simultaneously refers to __devinit and __devexit function +* which causes spurious section mismatch warning. So use __refdata to +* get rid from this. +*/ +static struct platform_driver __refdata sht_drivers[] = { { .driver = { .name ="sht10" ,
Looks sane, applied, thanks. Jonathan, no objection?
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors