public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>, Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: hid-sensors: avoid unused function warning
Date: Sun, 28 Aug 2016 14:49:20 -0700	[thread overview]
Message-ID: <1472420960.2480.2.camel@linux.intel.com> (raw)
In-Reply-To: <20160826152956.666025-1-arnd@arndb.de>

On Fri, 2016-08-26 at 17:29 +0200, Arnd Bergmann wrote:
A small rework of the PM code in this driver introduced a harmless
> warning when CONFIG_PM_SLEEP is not set:
> 
> drivers/iio/common/hid-sensors/hid-sensor-trigger.c:212:12: error:
> 'hid_sensor_resume' defined but not used [-Werror=unused-function]
> 
> This removes the #ifdef and instead marks all three PM functions
> as __maybe_unused, which covers all possible cases and is harder
> to get wrong.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 7f6cf7414538 ("iio: hid-sensors: use asynchronous resume")
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> index 5264ed6e03e5..a3cce3a38300 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> @@ -199,8 +199,7 @@ error_ret:
>  }
>  EXPORT_SYMBOL(hid_sensor_setup_trigger);
>  
> -#ifdef CONFIG_PM
> -static int hid_sensor_suspend(struct device *dev)
> +static int __maybe_unused hid_sensor_suspend(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> @@ -209,7 +208,7 @@ static int hid_sensor_suspend(struct device *dev)
>  	return _hid_sensor_power_state(attrb, false);
>  }
>  
> -static int hid_sensor_resume(struct device *dev)
> +static int __maybe_unused hid_sensor_resume(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> @@ -218,7 +217,7 @@ static int hid_sensor_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int hid_sensor_runtime_resume(struct device *dev)
> +static int __maybe_unused hid_sensor_runtime_resume(struct device
> *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> @@ -226,8 +225,6 @@ static int hid_sensor_runtime_resume(struct
> device *dev)
>  	return _hid_sensor_power_state(attrb, true);
>  }
>  
> -#endif
> -
>  const struct dev_pm_ops hid_sensor_pm_ops = {
>  	SET_SYSTEM_SLEEP_PM_OPS(hid_sensor_suspend,
> hid_sensor_resume)
>  	SET_RUNTIME_PM_OPS(hid_sensor_suspend,

  reply	other threads:[~2016-08-28 21:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 15:29 [PATCH] iio: hid-sensors: avoid unused function warning Arnd Bergmann
2016-08-28 21:49 ` Srinivas Pandruvada [this message]
2016-08-29 18:54 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472420960.2480.2.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox