* [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused
@ 2017-01-20 16:25 Arnd Bergmann
2017-01-21 12:35 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-01-20 16:25 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Arnd Bergmann, Kevin Tsai, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Linus Walleij, linux-iio, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused
2017-01-20 16:25 [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused Arnd Bergmann
@ 2017-01-21 12:35 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-01-21 12:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Kevin Tsai, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Linus Walleij, linux-iio, linux-kernel
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);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-21 12:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 16:25 [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused Arnd Bergmann
2017-01-21 12:35 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome