diff mbox series

[04/30] iio: magnetometer: hmc5843: 'hmc5843_pm_ops' is unused in 1 of 3 files including hmc5843_core.h

Message ID 20200717165538.3275050-5-lee.jones@linaro.org (mailing list archive)
State New, archived
Headers show
Series Second batch of W=1 fixes for IIO | expand

Commit Message

Lee Jones July 17, 2020, 4:55 p.m. UTC
We know that it's okay for 'hmc5843_pm_ops' to be unused here.

Fixes the following W=1 kernel build warning(s):

 In file included from include/linux/device.h:25,
 from include/linux/iio/iio.h:10,
 from drivers/iio/magnetometer/hmc5843_core.c:16:
 drivers/iio/magnetometer/hmc5843.h:55:26: warning: ‘hmc5843_pm_ops’ defined but not used [-Wunused-const-variable=]
 55 | static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
 | ^~~~~~~~~~~~~~
 include/linux/pm.h:354:25: note: in definition of macro ‘SIMPLE_DEV_PM_OPS’
 354 | const struct dev_pm_ops name = { | ^~~~

Cc: Josef Gajdusek <atx@atx.name>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/iio/magnetometer/hmc5843.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron July 18, 2020, 3:34 p.m. UTC | #1
On Fri, 17 Jul 2020 17:55:12 +0100
Lee Jones <lee.jones@linaro.org> wrote:

> We know that it's okay for 'hmc5843_pm_ops' to be unused here.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  In file included from include/linux/device.h:25,
>  from include/linux/iio/iio.h:10,
>  from drivers/iio/magnetometer/hmc5843_core.c:16:
>  drivers/iio/magnetometer/hmc5843.h:55:26: warning: ‘hmc5843_pm_ops’ defined but not used [-Wunused-const-variable=]
>  55 | static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
>  | ^~~~~~~~~~~~~~
>  include/linux/pm.h:354:25: note: in definition of macro ‘SIMPLE_DEV_PM_OPS’
>  354 | const struct dev_pm_ops name = { | ^~~~
> 
> Cc: Josef Gajdusek <atx@atx.name>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Seems like a sensible solution to me.

Applied to the togreg branch of iio.git an pushed out as testing to see if
we missed anything.

Thanks,

Jonathan

> ---
>  drivers/iio/magnetometer/hmc5843.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/hmc5843.h b/drivers/iio/magnetometer/hmc5843.h
> index b0dee87a8b20e..3f6c0b6629415 100644
> --- a/drivers/iio/magnetometer/hmc5843.h
> +++ b/drivers/iio/magnetometer/hmc5843.h
> @@ -52,9 +52,9 @@ int hmc5843_common_suspend(struct device *dev);
>  int hmc5843_common_resume(struct device *dev);
>  
>  #ifdef CONFIG_PM_SLEEP
> -static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
> -		hmc5843_common_suspend,
> -		hmc5843_common_resume);
> +static __maybe_unused SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
> +					hmc5843_common_suspend,
> +					hmc5843_common_resume);
>  #define HMC5843_PM_OPS (&hmc5843_pm_ops)
>  #else
>  #define HMC5843_PM_OPS NULL
diff mbox series

Patch

diff --git a/drivers/iio/magnetometer/hmc5843.h b/drivers/iio/magnetometer/hmc5843.h
index b0dee87a8b20e..3f6c0b6629415 100644
--- a/drivers/iio/magnetometer/hmc5843.h
+++ b/drivers/iio/magnetometer/hmc5843.h
@@ -52,9 +52,9 @@  int hmc5843_common_suspend(struct device *dev);
 int hmc5843_common_resume(struct device *dev);
 
 #ifdef CONFIG_PM_SLEEP
-static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
-		hmc5843_common_suspend,
-		hmc5843_common_resume);
+static __maybe_unused SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
+					hmc5843_common_suspend,
+					hmc5843_common_resume);
 #define HMC5843_PM_OPS (&hmc5843_pm_ops)
 #else
 #define HMC5843_PM_OPS NULL