hwmon: (ibmpowernv) Remove bogus __init annotations
Subsystems (2)
PATCH 1/1 hwmon: (ibmpowernv) Remove bogus __init annotations
If gcc decides not to inline make_sensor_label():
WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label() The function .create_device_attrs() references
the function __init .make_sensor_label().
This is often because .create_device_attrs lacks a __init
annotation or the annotation of .make_sensor_label is wrong.
As .probe() can be called after freeing of __init memory, all __init annotiations in the driver are bogus, and should be removed.
---
Compile-tested only.
--- drivers/hwmon/ibmpowernv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/hwmon/ibmpowernv.c +3 -4
@@ -181,7 +181,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr,return sprintf (buf,"%s\n" , sdata->label); } -static int __init get_logical_cpu (int hwcpu) +static int get_logical_cpu (int hwcpu) {int cpu;
@@ -192,9 +192,8 @@ static int __init get_logical_cpu(int hwcpu)return -ENOENT ; } -static void __init make_sensor_label (struct device_node *np, -struct sensor_data *sdata, -const char *label) +static void make_sensor_label (struct device_node *np, +struct sensor_data *sdata,const char *label) {u32 id;size_t n;
Signature · 1 line
2.17.1
Quoted 8 lines · Geert Uytterhoeven
If gcc decides not to inline
make_sensor_label():WARNING:
vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label() The function .create_device_attrs() references
the function__init.make_sensor_label().
This is often because .create_device_attrs lacks a__init
annotation or the annotation of .make_sensor_label is wrong.
Quoted 4 lines
As .probe() can be called after freeing of
__initmemory, all__initannotiations in the driver are bogus, and should be removed.Signed-off-by Geert Uytterhoeven <[email protected]>
Applied.
Thanks,
Guenter
Quoted 31 lines
---
Compile-tested only.--- drivers/hwmon/ibmpowernv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/hwmon/ibmpowernv.c +3
-4@@ -181,7 +181,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr,return sprintf (buf,"%s\n" , sdata->label); } -static int __init get_logical_cpu (int hwcpu) +static int get_logical_cpu (int hwcpu) {int cpu;@@ -192,9 +192,8 @@ static int __init get_logical_cpu(int hwcpu)return -ENOENT ; } -static void __init make_sensor_label (struct device_node *np, -struct sensor_data *sdata, -const char *label) +static void make_sensor_label (struct device_node *np, +struct sensor_data *sdata,const char *label) {u32 id;size_t n;