From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751279AbdAPO7l (ORCPT ); Mon, 16 Jan 2017 09:59:41 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:35844 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbdAPO7j (ORCPT ); Mon, 16 Jan 2017 09:59:39 -0500 MIME-Version: 1.0 In-Reply-To: <1484577077-13418-1-git-send-email-augustocaringi@gmail.com> References: <1484577077-13418-1-git-send-email-augustocaringi@gmail.com> From: Andy Shevchenko Date: Mon, 16 Jan 2017 16:59:38 +0200 Message-ID: Subject: Re: [PATCH] gpio: intel-mid: Fix build warning when !CONFIG_PM To: Augusto Mecking Caringi Cc: David Cohen , Linus Walleij , Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v0GExkVA031409 On Mon, Jan 16, 2017 at 4:30 PM, Augusto Mecking Caringi 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 > > Signed-off-by: Augusto Mecking Caringi > --- > 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