From patchwork Tue Sep 6 13:30:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9316899 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 33E5860752 for ; Tue, 6 Sep 2016 13:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2879628C51 for ; Tue, 6 Sep 2016 13:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B90F28C9B; Tue, 6 Sep 2016 13:30:15 +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=-1.8 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8B9928C51 for ; Tue, 6 Sep 2016 13:30:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4430D6E5DC; Tue, 6 Sep 2016 13:30:12 +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 [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id E15BA6E5DC for ; Tue, 6 Sep 2016 13:30:10 +0000 (UTC) Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MMWH0-1bhq0W0eUw-008JFn; Tue, 06 Sep 2016 15:29:58 +0200 From: Arnd Bergmann To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park Subject: [PATCH, RESEND] drm: exynos: avoid unused function warning Date: Tue, 6 Sep 2016 15:30:07 +0200 Message-Id: <20160906133027.2206326-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:az7PedPibKiQ4iE7XhxdEj81jmtzZ1CSErU6AQknc4kjrerlK2D to9iPUj7uwvsf2NpNvaVKpldKJAq6S98J8YNDFLvo+IWX+wG5D3K/hsALDgu3OYKwKaVGlg ClQYGrQnGx4kh2gqeiK0Wfi15No04oZXPABCZpECgsDroMz0W9GpGdBzIrgu8sVSzjPrQN0 MCZyOBsr7gzK+Q0pjS9qw== X-UI-Out-Filterresults: notjunk:1; V01:K0:rPmkGSF0FuY=:jgFPZJBx5k8m3sRj+Nn+Zf l4ATFtkG4+9QBp/wOpI2+li8b2FdjqcQJ7IYzvAScsvYmzgpzhhNn7iNI2bZrIh/U9V0+5v95 omWOnPCtHLbbtKjXUJK4tAkPi/dFwC+i4zKrs0uGMLWv/S/ciz9NczQnCKz5zyYkdGtEPlizv 9DGXV+hv2HoZdOFZdgCkrRR8ds8KH8XEVBBcXGx4pXYFjyzOMp50/YA4cRSrahMpKt7j238Zy IjadZQcAYQ8z98wD8DkXwOnoENPzT/BC0XwmcmwXIm5lsFNPbp2KmiZ6GrLawqeusPZImIXdP UoQ8oum2T9Sb/ROqXq1/ci81N773S8I9HvpFMt4VRXCBGk0mQR9/dXl6xzB54LeS+vXa5+r+6 j3cTkAeUE2BE3hTDl5xZW1bnljPnP4H0GqF9dCOzRTb+hS7kqKEVz/eHYo1ZKqUBWFY+Q0LEp pJ2uvfv22acWZlvgRjRO/LZjofPog/Bn+ecn3ZQTG4OjxjfGg0p4U8HDlyj0clXuYUuHRyuQD eenGXHcefXbj9GqqontXBpAXmPeH8a6EP+2yaAhu7mcAqsc6qIFXjEMeZSwCNrVIdAjN9Lbwn g+1p5jMW6f/qNLHA7q4+HLOmYSJ5+f3rItsjWf4UIE6JESihUJv5UH6SAfr65aU4cHQW5aa0j v+2UlZBVnTQT+LW34/k9TraLiCRHtxGM0MQ5wBGO0blHHg/9xo1jWPtoJswIwO1TTLnw= Cc: linux-samsung-soc@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Javier Martinez Canillas , Kukjin Kim , dri-devel@lists.freedesktop.org, Ingi Kim , 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 Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) Originally sent on July 11, but I just got this again and noticed it had never been applied, and I didn't get any reply for the patch. 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)