hwmon: (lis3lv02d_i2c) Fix compile
Jean Delvare
Acked-byHi Guenter,
Quoted 1 line · Guenter Roeck
Signed-off-by Guenter Roeck <[email protected]>
When sending a patch which removes a warning, I suggest including that warning in the description. Without the warning, it's difficult to review the proposed code change.
Quoted 24 lines
--- drivers/hwmon/lis3lv02d_i2c.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)drivers/hwmon/lis3lv02d_i2c.c +2
-5@@ -213,12 +213,9 @@ static int lis3lv02d_i2c_resume(struct device *dev)/join #bonjour jreturn 0 ; } -#else -#define lis3lv02d_i2c_suspend NULL -#define lis3lv02d_i2c_resume NULL -#define lis3lv02d_i2c_shutdown NULL -#endif +#endif /* CONFIG_PM */ +#ifdef CONFIG_PM_RUNTIME static int lis3_i2c_runtime_suspend (struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev);
drivers/hwmon/lis3lv02d_i2c.c static int lis3_i2c_runtime_resume(struct device *dev) · line 239
Quoted 7 lines
drivers/hwmon/lis3lv02d_i2c.c +1
-0@@ -236,6 +233,7 @@ static int lis3_i2c_runtime_resume(struct device *dev)lis3lv02d_poweron (lis3);return 0 ; } +#endif /* CONFIG_PM_RUNTIME */ static const struct i2c_device_id lis3lv02d_id[] = { {"lis3lv02d" ,0 },
The fix looks sane to me.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Jean Delvare
Hi Guenter,
Quoted 1 line · Guenter Roeck
Signed-off-by Guenter Roeck <[email protected]>When sending a patch which removes a warning, I suggest including that warning in the description. Without the warning, it's difficult to review the proposed code change.
Good point. Resent with warnings added. Hopefully it makes it to the list this time.
The warnings are from the "Build regressions/improvements in v2.6.37-rc2" post sent to lkml. There is another one in there, but I have no idea how to fix it. I'll send it to the list for input.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 1/1 hwmon: (lis3lv02d_i2c) Fix compile warnings if
In reply to Jean DelvareThis commit fixes the following compile warnings.
From v2.6.37-rc2/m68k/m68k-allmodconfig, v2.6.37-rc2/powerpc/powerpc-randconfig:drivers/hwmon/lis3lv02d_i2c.c:222: warning: 'lis3_i2c_runtime_suspend' defined but not used drivers/hwmon/lis3lv02d_i2c.c:231: warning: 'lis3_i2c_runtime_resume' defined but not used
From v2.6.37-rc2/sh4/sh-allyesconfig:drivers/hwmon/lis3lv02d_i2c.c:191: warning: 'lis3lv02d_i2c_suspend' defined but not used drivers/hwmon/lis3lv02d_i2c.c:201: warning: 'lis3lv02d_i2c_resume' defined but not used
---
Resent. Previous post did not make it to the mailing list. Also added the fixed warnings.
drivers/hwmon/lis3lv02d_i2c.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/hwmon/lis3lv02d_i2c.c +3 -5
@@ -213,12 +213,9 @@ static int lis3lv02d_i2c_resume(struct device *dev)return 0 ; } -#else -#define lis3lv02d_i2c_suspend NULL -#define lis3lv02d_i2c_resume NULL -#define lis3lv02d_i2c_shutdown NULL -#endif +#endif /* CONFIG_PM */ +#ifdef CONFIG_PM_RUNTIME static int lis3_i2c_runtime_suspend (struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev);
@@ -236,6 +233,7 @@ static int lis3_i2c_runtime_resume(struct device *dev)lis3lv02d_poweron (lis3);return 0 ; } +#endif /* CONFIG_PM_RUNTIME */ static const struct i2c_device_id lis3lv02d_id[] = { {"lis3lv02d" ,0 },
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 5 lines · Guenter Roeck
This commit fixes the following compile warnings.
From v2.6.37-rc2/m68k/m68k-allmodconfig, v2.6.37-rc2/powerpc/powerpc-randconfig:
drivers/hwmon/lis3lv02d_i2c.c:222: warning: 'lis3_i2c_runtime_suspend' defined but not useddrivers/hwmon/lis3lv02d_i2c.c:231: warning: 'lis3_i2c_runtime_resume' defined but not used
Your patch definitely fixes that one.
Quoted 4 lines
From v2.6.37-rc2/sh4/sh-allyesconfig:
drivers/hwmon/lis3lv02d_i2c.c:191: warning: 'lis3lv02d_i2c_suspend' defined but not useddrivers/hwmon/lis3lv02d_i2c.c:201: warning: 'lis3lv02d_i2c_resume' defined but not used
But that one? I doubt it. If CONFIG_PM is set but CONFIG_PM_SLEEP isn't, it's still present. I don't think it can happen on x86, but apparently on sh4 it can.
Quoted 36 lines
Signed-off-by Guenter Roeck <[email protected]>---
Resent. Previous post did not make it to the mailing list. Also added the fixed warnings.drivers/hwmon/lis3lv02d_i2c.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)drivers/hwmon/lis3lv02d_i2c.c +3
-5@@ -213,12 +213,9 @@ static int lis3lv02d_i2c_resume(struct device *dev)return 0 ; } -#else -#define lis3lv02d_i2c_suspend NULL -#define lis3lv02d_i2c_resume NULL -#define lis3lv02d_i2c_shutdown NULL -#endif +#endif /* CONFIG_PM */ +#ifdef CONFIG_PM_RUNTIME static int lis3_i2c_runtime_suspend (struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev);@@ -236,6 +233,7 @@ static int lis3_i2c_runtime_resume(struct device *dev)lis3lv02d_poweron (lis3);return 0 ; } +#endif /* CONFIG_PM_RUNTIME */ static const struct i2c_device_id lis3lv02d_id[] = { {"lis3lv02d" ,0 },
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 12 lines · Jean Delvare
Hi Guenter,
Quoted 5 lines · Guenter Roeck
This commit fixes the following compile warnings.
From v2.6.37-rc2/m68k/m68k-allmodconfig, v2.6.37-rc2/powerpc/powerpc-randconfig:
drivers/hwmon/lis3lv02d_i2c.c:222: warning: 'lis3_i2c_runtime_suspend' defined but not useddrivers/hwmon/lis3lv02d_i2c.c:231: warning: 'lis3_i2c_runtime_resume' defined but not usedYour patch definitely fixes that one.
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
From v2.6.37-rc2/sh4/sh-allyesconfig:
drivers/hwmon/lis3lv02d_i2c.c:191: warning: 'lis3lv02d_i2c_suspend' defined but not useddrivers/hwmon/lis3lv02d_i2c.c:201: warning: 'lis3lv02d_i2c_resume' defined but not usedBut that one? I doubt it. If
CONFIG_PMis set butCONFIG_PM_SLEEPisn't, it's still present. I don't think it can happen on x86, but apparently on sh4 it can.
One never stops learning. Looks like I'll have to use #ifdef CONFIG_PM_SLEEP.
Guenter
Quoted 40 lines
Quoted 36 lines
Signed-off-by Guenter Roeck <[email protected]>---
Resent. Previous post did not make it to the mailing list. Also added the fixed warnings.drivers/hwmon/lis3lv02d_i2c.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)drivers/hwmon/lis3lv02d_i2c.c +3
-5@@ -213,12 +213,9 @@ static int lis3lv02d_i2c_resume(struct device *dev)return 0 ; } -#else -#define lis3lv02d_i2c_suspend NULL -#define lis3lv02d_i2c_resume NULL -#define lis3lv02d_i2c_shutdown NULL -#endif +#endif /* CONFIG_PM */ +#ifdef CONFIG_PM_RUNTIME static int lis3_i2c_runtime_suspend (struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev);@@ -236,6 +233,7 @@ static int lis3_i2c_runtime_resume(struct device *dev)lis3lv02d_poweron (lis3);return 0 ; } +#endif /* CONFIG_PM_RUNTIME */ static const struct i2c_device_id lis3lv02d_id[] = { {"lis3lv02d" ,0 },Signature · 1 line
Jean Delvare
Signature · 8 lines
Guenter Roeck Distinguished Engineer PDU IP Systems _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 12 lines · Jean Delvare
Hi Guenter,
Quoted 5 lines · Guenter Roeck
This commit fixes the following compile warnings.
From v2.6.37-rc2/m68k/m68k-allmodconfig, v2.6.37-rc2/powerpc/powerpc-randconfig:
drivers/hwmon/lis3lv02d_i2c.c:222: warning: 'lis3_i2c_runtime_suspend' defined but not useddrivers/hwmon/lis3lv02d_i2c.c:231: warning: 'lis3_i2c_runtime_resume' defined but not usedYour patch definitely fixes that one.
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
From v2.6.37-rc2/sh4/sh-allyesconfig:
drivers/hwmon/lis3lv02d_i2c.c:191: warning: 'lis3lv02d_i2c_suspend' defined but not useddrivers/hwmon/lis3lv02d_i2c.c:201: warning: 'lis3lv02d_i2c_resume' defined but not usedBut that one? I doubt it. If
CONFIG_PMis set butCONFIG_PM_SLEEPisn't, it's still present. I don't think it can happen on x86, but apparently on sh4 it can.
It can happen on x86 as well. You have to disable hibernation, suspend, and xen support.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors