Skip to contentSkip to conversation

mfd: as3722: mark PM functions as __maybe_unused

PATCH Applied Arnd Bergmann 2 participants 2 messages Dec 8, 2015 – Jan 11, 2016 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: as3722: mark PM functions as __maybe_unused

The newly introduced as3722_i2c_suspend/resume functions are built unconditionally, but only used when power management is enabled, so we get a warning otherwise:

drivers/mfd/as3722.c:427:12: warning: 'as3722_i2c_suspend' defined but not used [-Wunused-function] drivers/mfd/as3722.c:438:12: warning: 'as3722_i2c_resume' defined but not used [-Wunused-function]

This marks them both as __maybe_unused, which avoids an ugly #ifdef and gives us best compile-time coverage. When they are unused, the compiler will silently drop the functions from its output.

Fixes 35deff7eb212 ("mfd: as3722: Handle interrupts on suspend")
---
 drivers/mfd/as3722.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/as3722.c +2 -2
index 3b21eb4bc480..e1f597f97f86 100644
@@ -424,7 +424,7 @@ static int as3722_i2c_remove(struct i2c_client *i2c)
 	return 0;
 }
 
-static int as3722_i2c_suspend(struct device *dev)
+static int __maybe_unused as3722_i2c_suspend(struct device *dev)
 {
 	struct as3722 *as3722 = dev_get_drvdata(dev);
 
@@ -435,7 +435,7 @@ static int as3722_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int as3722_i2c_resume(struct device *dev)
+static int __maybe_unused as3722_i2c_resume(struct device *dev)
 {
 	struct as3722 *as3722 = dev_get_drvdata(dev);
 
Signature · 1 line
2.1.0.rc2
Applied
#1 lore raw
Quoted 11 lines · Arnd Bergmann

The newly introduced as3722_i2c_suspend/resume functions are built unconditionally, but only used when power management is enabled, so we get a warning otherwise:

drivers/mfd/as3722.c:427:12: warning: 'as3722_i2c_suspend' defined but not used [-Wunused-function] drivers/mfd/as3722.c:438:12: warning: 'as3722_i2c_resume' defined but not used [-Wunused-function]

This marks them both as __maybe_unused, which avoids an ugly #ifdef and gives us best compile-time coverage. When they are unused, the compiler will silently drop the functions from its output.

Quoted 5 lines
Fixes 35deff7eb212 ("mfd: as3722: Handle interrupts on suspend")
---
 drivers/mfd/as3722.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Quoted 22 lines
drivers/mfd/as3722.c +2 -2
index 3b21eb4bc480..e1f597f97f86 100644
@@ -424,7 +424,7 @@ static int as3722_i2c_remove(struct i2c_client *i2c)
 	return 0;
 }
 
-static int as3722_i2c_suspend(struct device *dev)
+static int __maybe_unused as3722_i2c_suspend(struct device *dev)
 {
 	struct as3722 *as3722 = dev_get_drvdata(dev);
 
@@ -435,7 +435,7 @@ static int as3722_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int as3722_i2c_resume(struct device *dev)
+static int __maybe_unused as3722_i2c_resume(struct device *dev)
 {
 	struct as3722 *as3722 = dev_get_drvdata(dev);
 
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog