Skip to contentSkip to conversation

smiapp: Fix build warnings when !CONFIG_PM_SLEEP

PATCH In review Augusto Mecking Caringi 2 participants 2 messages Dec 29, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smiapp: Fix build warnings when !CONFIG_PM_SLEEP

Fix the following build warnings when CONFIG_PM is set but CONFIG_PM_SLEEP is not:

drivers/media/i2c/smiapp/smiapp-core.c:2746:12: warning:
‘smiapp_suspend’ defined but not used [-Wunused-function] static int smiapp_suspend(struct device *dev)

            ^
drivers/media/i2c/smiapp/smiapp-core.c:2771:12: warning: ‘smiapp_resume’
defined but not used [-Wunused-function]
static int smiapp_resume(struct device *dev)
            ^
---
 drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/smiapp/smiapp-core.c +1 -1
index 59872b3..a08465e 100644
@@ -2741,7 +2741,7 @@ static const struct v4l2_subdev_internal_ops smiapp_internal_ops = {
  * I2C Driver
  */
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 
 static int smiapp_suspend(struct device *dev)
 {
Signature · 1 line
2.7.4
#1 lore raw

Hi Augusto,

Quoted 6 lines · Augusto Mecking Caringi

Fix the following build warnings when CONFIG_PM is set but CONFIG_PM_SLEEP is not:

drivers/media/i2c/smiapp/smiapp-core.c:2746:12: warning:
‘smiapp_suspend’ defined but not used [-Wunused-function] static int smiapp_suspend(struct device *dev)

Quoted 7 lines
            ^
drivers/media/i2c/smiapp/smiapp-core.c:2771:12: warning: ‘smiapp_resume’
defined but not used [-Wunused-function]
static int smiapp_resume(struct device *dev)
            ^

Thanks for the patch.

I believe this is already fixed by the following patch:

commit 4bfb934b0067b7f6a24470682c5f7254fd4d8282

Author: Sakari Ailus <[email protected]>
Date:   Sat Nov 19 19:50:10 2016 -0200

[media] smiapp: Make suspend and resume functions __maybe_unused

The smiapp_suspend() and smiapp_resume() functions will end up being unused if CONFIG_PM is enabled but CONFIG_PM_SLEEP is disabled, causing a compiler warning from both of the function definitions. Fix this by marking the functions with __maybe_unused.

drivers/media/i2c/smiapp/smiapp-core.c +2 -2
index 620f8ce..f4e92bd 100644
@@ -2741,7 +2741,7 @@ static const struct v4l2_subdev_internal_ops smiapp_internal_ops = {
  * I2C Driver
  */
 
-static int smiapp_suspend(struct device *dev)
+static int __maybe_unused smiapp_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct v4l2_subdev *subdev = i2c_get_clientdata(client);
@@ -2766,7 +2766,7 @@ static int smiapp_suspend(struct device *dev)
 	return 0;
 }
 
-static int smiapp_resume(struct device *dev)
+static int __maybe_unused smiapp_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct v4l2_subdev *subdev = i2c_get_clientdata(client);
Signature · 4 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]