From patchwork Mon Jul 11 21:51:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102028 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp155232qga; Mon, 11 Jul 2016 14:49:40 -0700 (PDT) X-Received: by 10.66.189.199 with SMTP id gk7mr39112610pac.158.1468273780906; Mon, 11 Jul 2016 14:49:40 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id st9si129139pab.84.2016.07.11.14.49.40; Mon, 11 Jul 2016 14:49:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 608256E416; Mon, 11 Jul 2016 21:49:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A52C6E416 for ; Mon, 11 Jul 2016 21:49:34 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0LqH6S-1as36446N6-00dm6k; Mon, 11 Jul 2016 23:49:25 +0200 From: Arnd Bergmann To: Inki Dae Subject: [PATCH] drm: exynos: avoid unused function warning Date: Mon, 11 Jul 2016 23:51:54 +0200 Message-Id: <20160711215258.2725710-1-arnd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of Kozlowski , linux-samsung-soc@vger.kernel.org, Arnd Bergmann , Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , Hyungwon Hwang , Gustavo Padovan , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When CONFIG_PM is not set, we get a warning about an unused function: drivers/gpu/drm/exynos/exynos_drm_gsc.c:1219:12: error: 'gsc_clk_ctrl' defined but not used [-Werror=unused-function] static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable) ^~~~~~~~~~~~ This removes the two #ifdef checks in this file and instead marks the functions as __maybe_unused, which is a more reliable way of doing the same, allowing better build coverage and avoiding the warning above. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5d20da8f957e..b0a773790f85 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1760,8 +1760,7 @@ static int gsc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int gsc_suspend(struct device *dev) +static int __maybe_unused gsc_suspend(struct device *dev) { struct gsc_context *ctx = get_gsc_context(dev); @@ -1773,7 +1772,7 @@ static int gsc_suspend(struct device *dev) return gsc_clk_ctrl(ctx, false); } -static int gsc_resume(struct device *dev) +static int __maybe_unused gsc_resume(struct device *dev) { struct gsc_context *ctx = get_gsc_context(dev); @@ -1784,10 +1783,8 @@ static int gsc_resume(struct device *dev) return 0; } -#endif -#ifdef CONFIG_PM -static int gsc_runtime_suspend(struct device *dev) +static int __maybe_unused gsc_runtime_suspend(struct device *dev) { struct gsc_context *ctx = get_gsc_context(dev); @@ -1796,7 +1793,7 @@ static int gsc_runtime_suspend(struct device *dev) return gsc_clk_ctrl(ctx, false); } -static int gsc_runtime_resume(struct device *dev) +static int __maybe_unused gsc_runtime_resume(struct device *dev) { struct gsc_context *ctx = get_gsc_context(dev); @@ -1804,7 +1801,6 @@ static int gsc_runtime_resume(struct device *dev) return gsc_clk_ctrl(ctx, true); } -#endif static const struct dev_pm_ops gsc_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume)