* [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM
@ 2017-01-16 14:30 Augusto Mecking Caringi
2017-01-16 14:59 ` Andy Shevchenko
2017-01-17 15:09 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Augusto Mecking Caringi @ 2017-01-16 14:30 UTC (permalink / raw)
To: David Cohen
Cc: Augusto Mecking Caringi, Linus Walleij, Alexandre Courbot,
linux-gpio, linux-kernel
The only usage of function intel_gpio_runtime_idle() is here (in the
same file):
static const struct dev_pm_ops intel_gpio_pm_ops = {
SET_RUNTIME_PM_OPS(NULL, NULL, intel_gpio_runtime_idle)
};
And when CONFIG_PM is not set, the macro SET_RUNTIME_PM_OPS expands to
nothing, causing the following compiler warning:
drivers/gpio/gpio-intel-mid.c:324:12: warning: ‘intel_gpio_runtime_idle’
defined but not used [-Wunused-function]
static int intel_gpio_runtime_idle(struct device *dev)
Fix it by annotating the function with __maybe_unused.
Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
---
drivers/gpio/gpio-intel-mid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
index a1e44c2..b76ecee 100644
--- a/drivers/gpio/gpio-intel-mid.c
+++ b/drivers/gpio/gpio-intel-mid.c
@@ -321,7 +321,7 @@ static void intel_mid_irq_init_hw(struct intel_mid_gpio *priv)
}
}
-static int intel_gpio_runtime_idle(struct device *dev)
+static int __maybe_unused intel_gpio_runtime_idle(struct device *dev)
{
int err = pm_schedule_suspend(dev, 500);
return err ?: -EBUSY;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM
2017-01-16 14:30 [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM Augusto Mecking Caringi
@ 2017-01-16 14:59 ` Andy Shevchenko
2017-01-17 15:09 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2017-01-16 14:59 UTC (permalink / raw)
To: Augusto Mecking Caringi
Cc: David Cohen, Linus Walleij, Alexandre Courbot, linux-gpio, linux-kernel
On Mon, Jan 16, 2017 at 4:30 PM, Augusto Mecking Caringi
<augustocaringi@gmail.com> wrote:
> The only usage of function intel_gpio_runtime_idle() is here (in the
> same file):
>
> static const struct dev_pm_ops intel_gpio_pm_ops = {
> SET_RUNTIME_PM_OPS(NULL, NULL, intel_gpio_runtime_idle)
> };
>
> And when CONFIG_PM is not set, the macro SET_RUNTIME_PM_OPS expands to
> nothing, causing the following compiler warning:
>
> drivers/gpio/gpio-intel-mid.c:324:12: warning: ‘intel_gpio_runtime_idle’
> defined but not used [-Wunused-function]
> static int intel_gpio_runtime_idle(struct device *dev)
>
> Fix it by annotating the function with __maybe_unused.
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
> ---
> drivers/gpio/gpio-intel-mid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
> index a1e44c2..b76ecee 100644
> --- a/drivers/gpio/gpio-intel-mid.c
> +++ b/drivers/gpio/gpio-intel-mid.c
> @@ -321,7 +321,7 @@ static void intel_mid_irq_init_hw(struct intel_mid_gpio *priv)
> }
> }
>
> -static int intel_gpio_runtime_idle(struct device *dev)
> +static int __maybe_unused intel_gpio_runtime_idle(struct device *dev)
> {
> int err = pm_schedule_suspend(dev, 500);
> return err ?: -EBUSY;
> --
> 2.7.4
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM
2017-01-16 14:30 [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM Augusto Mecking Caringi
2017-01-16 14:59 ` Andy Shevchenko
@ 2017-01-17 15:09 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2017-01-17 15:09 UTC (permalink / raw)
To: Augusto Mecking Caringi
Cc: David Cohen, Alexandre Courbot, linux-gpio, linux-kernel
On Mon, Jan 16, 2017 at 3:30 PM, Augusto Mecking Caringi
<augustocaringi@gmail.com> wrote:
> The only usage of function intel_gpio_runtime_idle() is here (in the
> same file):
>
> static const struct dev_pm_ops intel_gpio_pm_ops = {
> SET_RUNTIME_PM_OPS(NULL, NULL, intel_gpio_runtime_idle)
> };
>
> And when CONFIG_PM is not set, the macro SET_RUNTIME_PM_OPS expands to
> nothing, causing the following compiler warning:
>
> drivers/gpio/gpio-intel-mid.c:324:12: warning: ‘intel_gpio_runtime_idle’
> defined but not used [-Wunused-function]
> static int intel_gpio_runtime_idle(struct device *dev)
>
> Fix it by annotating the function with __maybe_unused.
>
> Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
Patch applied with Andy's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-17 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-16 14:30 [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM Augusto Mecking Caringi
2017-01-16 14:59 ` Andy Shevchenko
2017-01-17 15:09 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).