Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548288 > unrolled thread

[PATCH] [media] smiapp: Fix build warnings when !CONFIG_PM_SLEEP

Started byAugusto Mecking Caringi <augustocaringi@gmail.com>
First post2016-12-29 12:50 +0100
Last post2016-12-29 13:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] smiapp: Fix build warnings when !CONFIG_PM_SLEEP Augusto Mecking Caringi <augustocaringi@gmail.com> - 2016-12-29 12:50 +0100
    Re: [PATCH] [media] smiapp: Fix build warnings when !CONFIG_PM_SLEEP Sakari Ailus <sakari.ailus@iki.fi> - 2016-12-29 13:10 +0100

#1548288 — [PATCH] [media] smiapp: Fix build warnings when !CONFIG_PM_SLEEP

FromAugusto Mecking Caringi <augustocaringi@gmail.com>
Date2016-12-29 12:50 +0100
Subject[PATCH] [media] smiapp: Fix build warnings when !CONFIG_PM_SLEEP
Message-ID<sTHnA-63D-9@gated-at.bofh.it>
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)
            ^

Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 59872b3..a08465e 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -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)
 {
-- 
2.7.4

[toc] | [next] | [standalone]


#1548294

FromSakari Ailus <sakari.ailus@iki.fi>
Date2016-12-29 13:10 +0100
Message-ID<sTHGV-6pF-1@gated-at.bofh.it>
In reply to#1548288
Hi Augusto,

On Thu, Dec 29, 2016 at 11:45:07AM +0000, Augusto Mecking Caringi wrote:
> 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)
>             ^
> 
> Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>

Thanks for the patch.

I believe this is already fixed by the following patch:

commit 4bfb934b0067b7f6a24470682c5f7254fd4d8282
Author: Sakari Ailus <sakari.ailus@linux.intel.com>
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.
    
    Suggested-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 620f8ce..f4e92bd 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -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);

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web