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


Groups > linux.kernel > #1563752 > unrolled thread

[PATCH] iio: light: cm3605: mark PM functions as __maybe_unused

Started byArnd Bergmann <arnd@arndb.de>
First post2017-01-20 17:30 +0100
Last post2017-01-21 13:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2017-01-20 17:30 +0100
    Re: [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused Jonathan Cameron <jic23@kernel.org> - 2017-01-21 13:50 +0100

#1563752 — [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused

FromArnd Bergmann <arnd@arndb.de>
Date2017-01-20 17:30 +0100
Subject[PATCH] iio: light: cm3605: mark PM functions as __maybe_unused
Message-ID<t1KeC-16c-15@gated-at.bofh.it>
When CONFIG_PM_SLEEP is disabled, we get a harmless warning

drivers/iio/light/cm3605.c:292:12: error: 'cm3605_pm_resume' defined but not used [-Werror=unused-function]
drivers/iio/light/cm3605.c:281:12: error: 'cm3605_pm_suspend' defined but not used [-Werror=unused-function]

Marking the functions as possibly unused avoids the warning without
needing to add an #ifdef.

Fixes: 8afa505c1230 ("iio: light: add driver for Capella CM3605")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/iio/light/cm3605.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c
index 2d96543db1ef..980624e9ffb5 100644
--- a/drivers/iio/light/cm3605.c
+++ b/drivers/iio/light/cm3605.c
@@ -278,7 +278,7 @@ static int cm3605_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int cm3605_pm_suspend(struct device *dev)
+static int __maybe_unused cm3605_pm_suspend(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct cm3605 *cm3605 = iio_priv(indio_dev);
@@ -289,7 +289,7 @@ static int cm3605_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int cm3605_pm_resume(struct device *dev)
+static int __maybe_unused cm3605_pm_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct cm3605 *cm3605 = iio_priv(indio_dev);
-- 
2.9.0

[toc] | [next] | [standalone]


#1564106

FromJonathan Cameron <jic23@kernel.org>
Date2017-01-21 13:50 +0100
Message-ID<t23hf-437-1@gated-at.bofh.it>
In reply to#1563752
On 20/01/17 16:25, Arnd Bergmann wrote:
> When CONFIG_PM_SLEEP is disabled, we get a harmless warning
> 
> drivers/iio/light/cm3605.c:292:12: error: 'cm3605_pm_resume' defined but not used [-Werror=unused-function]
> drivers/iio/light/cm3605.c:281:12: error: 'cm3605_pm_suspend' defined but not used [-Werror=unused-function]
> 
> Marking the functions as possibly unused avoids the warning without
> needing to add an #ifdef.
> 
> Fixes: 8afa505c1230 ("iio: light: add driver for Capella CM3605")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/light/cm3605.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c
> index 2d96543db1ef..980624e9ffb5 100644
> --- a/drivers/iio/light/cm3605.c
> +++ b/drivers/iio/light/cm3605.c
> @@ -278,7 +278,7 @@ static int cm3605_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int cm3605_pm_suspend(struct device *dev)
> +static int __maybe_unused cm3605_pm_suspend(struct device *dev)
>  {
>  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>  	struct cm3605 *cm3605 = iio_priv(indio_dev);
> @@ -289,7 +289,7 @@ static int cm3605_pm_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int cm3605_pm_resume(struct device *dev)
> +static int __maybe_unused cm3605_pm_resume(struct device *dev)
>  {
>  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>  	struct cm3605 *cm3605 = iio_priv(indio_dev);
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web