From patchwork Wed Mar 2 15:58:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8483261 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D2BEDC0553 for ; Wed, 2 Mar 2016 16:05:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA1342037C for ; Wed, 2 Mar 2016 16:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B8E420364 for ; Wed, 2 Mar 2016 16:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756488AbcCBQE1 (ORCPT ); Wed, 2 Mar 2016 11:04:27 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:51640 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756348AbcCBQAq (ORCPT ); Wed, 2 Mar 2016 11:00:46 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0M1QSH-1ZmTW60obB-00tVGC; Wed, 02 Mar 2016 17:00:03 +0100 From: Arnd Bergmann To: Matt Mackall , Herbert Xu , Kukjin Kim , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Dmitry Torokhov , Daniel Thompson , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/14] hw_random: exynos: use __maybe_unused to hide pm functions Date: Wed, 2 Mar 2016 16:58:59 +0100 Message-Id: <1456934350-1389172-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:tebVe36ilacPLx/VE6A2BkCsNsUw8GFlvi/Dak6IS/37f+D6r5J klGKDhGiRxKygafT7SXBbw/XXwSkmdX50SNPoKSpOa3h8P0sArUyV3BH0Qs+2pqBNZeXxFf l1UxaRkIEWKr3S2810hM8paZtkdJv0PZyxiG0dFEFAhLp3OQ2KSjNz9g14FE6rwjCDK5HeY 42OsAl4LY8IjKePa8dYtw== X-UI-Out-Filterresults: notjunk:1; V01:K0:M+OB3geWSnI=:cRwl4ua7NIJ4sNJ0Ri4gaz cD7rvFiujmhcTBc+OTlZXM3EjiYeOPXpmV74aZcZMsfDlLZ99CXAT9DGSB7Mxzd/LlDN4UZ2L NjZFLfiErJqXEGFIhHIbxcYNADDX2Wye+exAf6SUP7iF6lH3zNm18dIsQc5jgdXhwavh6A30I tR1yXcI4sB8eP8Nzo6T8+ZAoahLMUlPdhK84hy60pf53grj9QunEicK+venv7NsOha8hE1+Kb G6hT1iGPsblStozT1x7p7XNj9LWlVtWCgS5UxmkWwd0id2pZ7tMRKAgsa6Sm+tgUParcj40X0 bINHNlCuZ9gTqNSkU98mPcpw21mhm1iUJrQo4vyLnNPWmm/26/TfpZuuytcDlE9AnRlDs4khG Gj2rbDp2hn1WWVQCoakkEIMnudUQjXIVPde0XLWDe3LttpH14v8Zfat95MsdVsF8S+Eq1H0vK dAqiUo1U8zRBaLTJvm4GF4DX+X2W9FjouvkUlAsiA+PjBu8j1sZFeptJkV8rqndBkKQY4ZE2G O21tUikvpvJr96vHjBvlqRrOOf9d/Vwwh01ig5stih4pQb50L4AiOUWmwicJdM1EHl8v5uB72 tYZG/ee+YDCvdVsvUY5Rx4NdwLgmULrV+9dLKvOWZuYrChq5AEyM8oB6reDP1H5J5Oqenu4hC jJZDmt2nxWVTtuBleBfQCdxmV+limC0WLCtcVIY2TbtENtBtfi441T3N1PXUc2QVWoCU= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The exynos random driver uses #ifdef to check for CONFIG_PM, but then uses SIMPLE_DEV_PM_OPS, which leaves the references out when CONFIG_PM_SLEEP is not defined, so we get a warning with PM=y && PM_SLEEP=n: drivers/char/hw_random/exynos-rng.c:166:12: error: 'exynos_rng_suspend' defined but not used [-Werror=unused-function] drivers/char/hw_random/exynos-rng.c:171:12: error: 'exynos_rng_resume' defined but not used [-Werror=unused-function] This removes the incorrect #ifdef and instead uses a __maybe_unused annotation to let the compiler know it can silently drop the function definition. Signed-off-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski --- drivers/char/hw_random/exynos-rng.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index 30cf4623184f..ada081232528 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c @@ -144,8 +144,7 @@ static int exynos_rng_probe(struct platform_device *pdev) return devm_hwrng_register(&pdev->dev, &exynos_rng->rng); } -#ifdef CONFIG_PM -static int exynos_rng_runtime_suspend(struct device *dev) +static int __maybe_unused exynos_rng_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); @@ -155,7 +154,7 @@ static int exynos_rng_runtime_suspend(struct device *dev) return 0; } -static int exynos_rng_runtime_resume(struct device *dev) +static int __maybe_unused exynos_rng_runtime_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); @@ -163,12 +162,12 @@ static int exynos_rng_runtime_resume(struct device *dev) return clk_prepare_enable(exynos_rng->clk); } -static int exynos_rng_suspend(struct device *dev) +static int __maybe_unused exynos_rng_suspend(struct device *dev) { return pm_runtime_force_suspend(dev); } -static int exynos_rng_resume(struct device *dev) +static int __maybe_unused exynos_rng_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); @@ -180,7 +179,6 @@ static int exynos_rng_resume(struct device *dev) return exynos_rng_configure(exynos_rng); } -#endif static const struct dev_pm_ops exynos_rng_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(exynos_rng_suspend, exynos_rng_resume)