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: 9316903 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 E83D760752 for ; Tue, 6 Sep 2016 13:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDCDB28D51 for ; Tue, 6 Sep 2016 13:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1F5228D56; Tue, 6 Sep 2016 13:30:52 +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.5 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49D8928D51 for ; Tue, 6 Sep 2016 13:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933232AbcIFNas (ORCPT ); Tue, 6 Sep 2016 09:30:48 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:54754 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932893AbcIFNar (ORCPT ); Tue, 6 Sep 2016 09:30:47 -0400 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 Cc: Arnd Bergmann , David Airlie , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas , Marek Szyprowski , Gustavo Padovan , Ingi Kim , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org 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= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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)