Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] pinctrl: msm: mark PM functions as __maybe_unused
@ 2018-12-10 20:59 Arnd Bergmann
  2018-12-10 21:26 ` Evan Green
  2018-12-21 10:07 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:59 UTC (permalink / raw)
  To: Bjorn Andersson, Linus Walleij
  Cc: Arnd Bergmann, Stephen Boyd, Timur Tabi, Douglas Anderson,
	Ricardo Ribalda Delgado, Evan Green, linux-arm-msm, linux-gpio,
	linux-kernel

Without CONFIG_PM_SLEEP, we get annoyting warnings about unused functions:

drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function]
 static int msm_pinctrl_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~
drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function]
 static int msm_pinctrl_suspend(struct device *dev)

Mark them as __maybe_unused to shut up the warning and silently drop
the functions without having to add ugly #ifdefs.

Fixes: 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 87cbebe217fd..ee8119879c4c 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1072,14 +1072,14 @@ static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
 		}
 }
 
-static int msm_pinctrl_suspend(struct device *dev)
+static __maybe_unused int msm_pinctrl_suspend(struct device *dev)
 {
 	struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
 
 	return pinctrl_force_sleep(pctrl->pctrl);
 }
 
-static int msm_pinctrl_resume(struct device *dev)
+static __maybe_unused int msm_pinctrl_resume(struct device *dev)
 {
 	struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
 
-- 
2.20.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: msm: mark PM functions as __maybe_unused
  2018-12-10 20:59 [PATCH] pinctrl: msm: mark PM functions as __maybe_unused Arnd Bergmann
@ 2018-12-10 21:26 ` Evan Green
  2018-12-21 10:07 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Evan Green @ 2018-12-10 21:26 UTC (permalink / raw)
  To: arnd
  Cc: bjorn.andersson, linus.walleij, swboyd, timur, dianders,
	ricardo.ribalda, linux-arm-msm, linux-gpio, linux-kernel

On Mon, Dec 10, 2018 at 1:00 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> Without CONFIG_PM_SLEEP, we get annoyting warnings about unused functions:
>
> drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function]
>  static int msm_pinctrl_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~
> drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function]
>  static int msm_pinctrl_suspend(struct device *dev)
>
> Mark them as __maybe_unused to shut up the warning and silently drop
> the functions without having to add ugly #ifdefs.
>
> Fixes: 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 87cbebe217fd..ee8119879c4c 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -1072,14 +1072,14 @@ static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
>                 }
>  }
>
> -static int msm_pinctrl_suspend(struct device *dev)
> +static __maybe_unused int msm_pinctrl_suspend(struct device *dev)
>  {
>         struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
>
>         return pinctrl_force_sleep(pctrl->pctrl);
>  }
>
> -static int msm_pinctrl_resume(struct device *dev)
> +static __maybe_unused int msm_pinctrl_resume(struct device *dev)
>  {
>         struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
>

Thanks Arnd.

Reviewed-by: Evan Green <evgreen@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: msm: mark PM functions as __maybe_unused
  2018-12-10 20:59 [PATCH] pinctrl: msm: mark PM functions as __maybe_unused Arnd Bergmann
  2018-12-10 21:26 ` Evan Green
@ 2018-12-21 10:07 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2018-12-21 10:07 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bjorn Andersson, Stephen Boyd, Timur Tabi, Douglas Anderson,
	Ricardo Ribalda Delgado, Evan Green, linux-arm-msm,
	open list:GPIO SUBSYSTEM, linux-kernel@vger.kernel.org

On Mon, Dec 10, 2018 at 9:59 PM Arnd Bergmann <arnd@arndb.de> wrote:

> Without CONFIG_PM_SLEEP, we get annoyting warnings about unused functions:
>
> drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function]
>  static int msm_pinctrl_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~
> drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function]
>  static int msm_pinctrl_suspend(struct device *dev)
>
> Mark them as __maybe_unused to shut up the warning and silently drop
> the functions without having to add ugly #ifdefs.
>
> Fixes: 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied w/ACKs and fixing a typo.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-21 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-10 20:59 [PATCH] pinctrl: msm: mark PM functions as __maybe_unused Arnd Bergmann
2018-12-10 21:26 ` Evan Green
2018-12-21 10:07 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox