From patchwork Mon Mar 20 09:17:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9633537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 01077601E9 for ; Mon, 20 Mar 2017 09:32:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70A927FA0 for ; Mon, 20 Mar 2017 09:32:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA72E2807E; Mon, 20 Mar 2017 09:32:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6365F27FA0 for ; Mon, 20 Mar 2017 09:32:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cptgM-000229-7S; Mon, 20 Mar 2017 09:32:54 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cptgK-000223-Va for tpmdd-devel@lists.sourceforge.net; Mon, 20 Mar 2017 09:32:52 +0000 Received: from mout.kundenserver.de ([212.227.126.135]) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1cptgJ-0002Qj-Iq for tpmdd-devel@lists.sourceforge.net; Mon, 20 Mar 2017 09:32:52 +0000 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LodTi-1cIBGQ47yM-00gY4R; Mon, 20 Mar 2017 10:18:05 +0100 From: Arnd Bergmann To: Peter Huewe , Marcel Selhorst , Jarkko Sakkinen Date: Mon, 20 Mar 2017 10:17:19 +0100 Message-Id: <20170320091755.1043811-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:R5TtVjZRRZhN3dKFL+AYj+yFwmTEa2IosgiV6lRpweb3+gcWbEL WrAU3ShNwtZypTXIXDF2kuklpGA7aV0rED47u9LmTofnZKeR/IqvVQC0eH4tKhi6553aX/W LJezyWJ9CEWVPPS97fbKekIEKonIRm2a9nnSVr13VjyGO2XTEeqLI1PruQw9O/fb7Mmm4TO nk/2KBsAxK2V1v7YaCI/w== X-UI-Out-Filterresults: notjunk:1; V01:K0:Grz+h0/Jp9k=:bX4CDsHYUx86EK5Kf4M6a5 TbQky1p+OeRr2YA6b33ME/7m/1f7gz4cHsiEudcq2jipPI+pscJkvyx+KLg0s+1O9VXkqRh45 /bWW5gaYgXSBPHXNg/Kd3VgpFTqIqfJVqUGtTNfupKxF1NZTgIlgOCImAQ28uSuueXVMLMirz TS9c41+KXJKN266wh/MarxZkt9ZBumfH0ufwvk/ElL48f8SLXfFxzyJM/dpWS/A9SL0/42Yyj TLh9excKCysitowKYWB+2Agh4MOp+po9mO2iJwuFZ4UDPXsJ9+yHlmTbKyXHtLjnDZWkAeJgN YI156Gz400pHBeNKsJPts6tD4yXEWyLvJHjrbLytI6Kma7QwfB8eXPdVfaeLH56Bl6ctoW4i1 pAwgHA6K7Tr7ZXFHA3tiD4pLe4pwBRwdZBuuNxjHyjiQHHqIJKihgD7lHZ3z7GEGOOciKqXu4 F8OJuaFcRHzNol6pqBDzs2CMgeFWMCzm3oUuGP5uYfap2Uyr2m3oqP1ygocWxNlkMyHtqAQkq wW7LQ1p0eyR8DG+6EfhoMXl+GRg+kHsJO3ZZz+x873b30UYTurVJO3PHqY3bAYMlQB3GuEoYd qAPKnIZThW0VXvkjKPspFD2+e9tSR+Q0kV5Z3KNLF43aTd8m6txco6JtAP3WDt9Ouo4f8SjhB AQ5a3c3ww6orNpxCLLhPfRDTy4NquTNblGR8Ftvm+O7Dz/cvBy3uEwsqTxDozg4pRNWc= X-Headers-End: 1cptgJ-0002Qj-Iq Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net Subject: [tpmdd-devel] [PATCH] tpm/tpm_crb: mark PM functions as __maybe_unused X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_PM_SLEEP is disabled, we get a warning about unused functions: drivers/char/tpm/tpm_crb.c:551:12: error: 'crb_pm_resume' defined but not used [-Werror=unused-function] drivers/char/tpm/tpm_crb.c:540:12: error: 'crb_pm_suspend' defined but not used [-Werror=unused-function] We could solve this with more sophistated #ifdefs, but a simpler and safer way is to just mark them as __maybe_unused. Fixes: 848efcfb560c ("tpm/tpm_crb: enter the low power state upon device suspend") Signed-off-by: Arnd Bergmann --- drivers/char/tpm/tpm_crb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 1dfc37e33c02..15f1118982a6 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -519,8 +519,7 @@ static int crb_acpi_remove(struct acpi_device *device) return 0; } -#ifdef CONFIG_PM -static int crb_pm_runtime_suspend(struct device *dev) +static __maybe_unused int crb_pm_runtime_suspend(struct device *dev) { struct tpm_chip *chip = dev_get_drvdata(dev); struct crb_priv *priv = dev_get_drvdata(&chip->dev); @@ -528,7 +527,7 @@ static int crb_pm_runtime_suspend(struct device *dev) return crb_go_idle(dev, priv); } -static int crb_pm_runtime_resume(struct device *dev) +static __maybe_unused int crb_pm_runtime_resume(struct device *dev) { struct tpm_chip *chip = dev_get_drvdata(dev); struct crb_priv *priv = dev_get_drvdata(&chip->dev); @@ -536,7 +535,7 @@ static int crb_pm_runtime_resume(struct device *dev) return crb_cmd_ready(dev, priv); } -static int crb_pm_suspend(struct device *dev) +static __maybe_unused int crb_pm_suspend(struct device *dev) { int ret; @@ -547,7 +546,7 @@ static int crb_pm_suspend(struct device *dev) return crb_pm_runtime_suspend(dev); } -static int crb_pm_resume(struct device *dev) +static __maybe_unused int crb_pm_resume(struct device *dev) { int ret; @@ -558,8 +557,6 @@ static int crb_pm_resume(struct device *dev) return tpm_pm_resume(dev); } -#endif /* CONFIG_PM */ - static const struct dev_pm_ops crb_pm = { SET_SYSTEM_SLEEP_PM_OPS(crb_pm_suspend, crb_pm_resume) SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)