From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
Rajeev Kumar <rajeevkumar.linux@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 11/14] input: spear-keyboard: use __maybe_unused to hide pm functions
Date: Wed, 2 Mar 2016 09:12:57 -0800 [thread overview]
Message-ID: <20160302171257.GB4318@dtor-ws> (raw)
In-Reply-To: <1456934350-1389172-12-git-send-email-arnd@arndb.de>
On Wed, Mar 02, 2016 at 04:59:03PM +0100, Arnd Bergmann wrote:
> The spear keyboard driver uses #ifdef CONFIG_PM to hide its
> power management functions, but then uses references from
> SIMPLE_DEV_PM_OPS that are only present if both CONFIG_PM
> and CONFIG_PM_SLEEP are set, resulting in a warning about unused
> functions:
>
> drivers/input/keyboard/spear-keyboard.c:292:12: error: 'spear_kbd_suspend' defined but not used [-Werror=unused-function]
> drivers/input/keyboard/spear-keyboard.c:345:12: error: 'spear_kbd_resume' defined but not used [-Werror=unused-function]
>
> This removes the #ifdef and instead uses a __maybe_unused
> annotation.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thank you.
> ---
> drivers/input/keyboard/spear-keyboard.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
> index 623d451767e3..8083eaa0524a 100644
> --- a/drivers/input/keyboard/spear-keyboard.c
> +++ b/drivers/input/keyboard/spear-keyboard.c
> @@ -288,8 +288,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -static int spear_kbd_suspend(struct device *dev)
> +static int __maybe_unused spear_kbd_suspend(struct device *dev)
> {
> struct platform_device *pdev = to_platform_device(dev);
> struct spear_kbd *kbd = platform_get_drvdata(pdev);
> @@ -342,7 +341,7 @@ static int spear_kbd_suspend(struct device *dev)
> return 0;
> }
>
> -static int spear_kbd_resume(struct device *dev)
> +static int __maybe_unused spear_kbd_resume(struct device *dev)
> {
> struct platform_device *pdev = to_platform_device(dev);
> struct spear_kbd *kbd = platform_get_drvdata(pdev);
> @@ -368,7 +367,6 @@ static int spear_kbd_resume(struct device *dev)
>
> return 0;
> }
> -#endif
>
> static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume);
>
> --
> 2.7.0
>
--
Dmitry
next prev parent reply other threads:[~2016-03-02 17:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 15:58 [PATCH 00/14] drivers: use __maybe_unused to hide pm functions Arnd Bergmann
2016-03-02 15:59 ` [PATCH 11/14] input: spear-keyboard: " Arnd Bergmann
2016-03-02 17:12 ` Dmitry Torokhov [this message]
2016-03-02 15:59 ` [PATCH 12/14] keyboard: snvs-pwrkey: " Arnd Bergmann
2016-03-02 16:04 ` Frank Li
2016-03-02 17:12 ` Dmitry Torokhov
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=20160302171257.GB4318@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rajeevkumar.linux@gmail.com \
/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