Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756513AbcCBQE3 (ORCPT ); Wed, 2 Mar 2016 11:04:29 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2516 Lines: 65 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 --- 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) -- 2.7.0