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: 9224297 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 CC37060572 for ; Mon, 11 Jul 2016 21:49:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE03427569 for ; Mon, 11 Jul 2016 21:49:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B168527C14; Mon, 11 Jul 2016 21:49:41 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F53727569 for ; Mon, 11 Jul 2016 21:49:40 +0000 (UTC) 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@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:g+lR3Fe/tyO+tiXPq6605FSceY2i24uGF1wP/t73AquVEJWK/yg ZEvx2xSwjeihsCUQwUzHvUZR3eVCtUUeY0xCNF4qYIuosXbM3QLvXQMWjomfzs9Gt6rczMy 5aAkZ7JkdOsahKNJ1hrCXNp1mjIKq8SRC2L6ButSwTsAC7Qpc4SRV9NKqe+Tb+FEKnS73fG CLsBoRJhqsv0/l+cqC7jA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Z4zKF3Z0SFE=:Aq9EtdjOSlmEh/izgt5OTg idaJnFC4x23L6+8h8rxM1OEF5g4iOyMHDth7ALG8rwAOBFOtQsHN+6xqT+UzGhBwaCX2mbdVE OABXa9jEsQFaS7wh105NJ3u+DXNv2r82/5ItkElQNR9IReF6CL049xEHFmrTd+Kp7iUbOXRjb o/R1RteQxqGBpZGXJ9OqHCisvTpJo145vioBJ8AufLz/TJVffujvtgB8Pf47FPy+0uDSMZljv 6FvDKw5ak66xSAlfsC90sF/dOmOVH7vw7LpEaJmDsRN3KlkZQabW94UhGWUfMslgybAKkYRMT TmY7+LLFiNZM1PDZDt9sM/vrvdnyYYw59hxY8ezEo8Qi13thkoDUP0XmoH3J1xaoCEMiYFYB1 Cdv2eo4WYnRhEPs8yhUEf71IiUx2BeD9sLcaFlMkyQySPER4LqzGwy4eDFTk8h4VeWPJrSoNH 8ty9Ldh7EMBKtb/KCCSLifwXvHw3J2l9r528h5Whqtm8ASo8/rCRQB3/l1Ho2d5+w8XC4kOUt ZuJ7HA38PpWalcEF4XiSSZWyA+9Jz69XSy2hFmzYXoTAwrBPKXZirf3lJVTYsdI1Dsu0jyRI9 yGcb3IdTbY4bP1I1ebRg1K1BAEIAXtZCXYkIo9NI7izEQvX42jP3w4L9a4y3Z8Itm7jId44Nu fEkP4Y1ql4GfblaDWnv+DeLv0E0a8YvpettZDMMkTEb6Nt1jKR+Il9hiJXzdHLGQgU6c= Cc: Krzysztof 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" X-Virus-Scanned: ClamAV using ClamSMTP 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)