From patchwork Mon Jan 25 15:04:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8109391 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 284999F1CC for ; Mon, 25 Jan 2016 15:08:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E87D202B8 for ; Mon, 25 Jan 2016 15:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A25A5202BE for ; Mon, 25 Jan 2016 15:08:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757336AbcAYPIX (ORCPT ); Mon, 25 Jan 2016 10:08:23 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:52223 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756446AbcAYPIW (ORCPT ); Mon, 25 Jan 2016 10:08:22 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0LiKia-1ZpkrV3hjI-00ce2b; Mon, 25 Jan 2016 16:05:14 +0100 From: Arnd Bergmann To: Tomi Valkeinen Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Jean-Christophe Plagniol-Villard , Kukjin Kim , Krzysztof Kozlowski , linux-fbdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: s6e8ax0: avoid unused function warnings Date: Mon, 25 Jan 2016 16:04:03 +0100 Message-Id: <1453734300-1958304-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:kDAx/A3mnYTnEXn5qK///1KbSsP5kpGG8htIHdATOuLwOHkE1Qg b5EpTw7pVv8rua4qoQE4+/2wkGI1+RDYFmnW42f1C9KJRCToqDbYyoJ1shipmbqywrxW/b5 JcTLT2McoTj0YIJeuJmHu+D21nvjAVFkEHD7Al8BwoZcLeqtNuAgS1+CBHmttroCGEG/P+D 1U57X+qSThbZaKM7FRj1w== X-UI-Out-Filterresults: notjunk:1; V01:K0:8w727vv5DSw=:pX23eRlggyOpQmS7QOGH7f CRfGBEe6zNqoLXRimkrZJW7SDHKZ2+FsSr/axfr57I1bymSK3IrJ0RdcKZjvv4cncdexVW96s alHJr9nZlj+RMmvbUaDEUAd3E8AmfgTHd9EzByp+vOgOI7dtn8x6L/VO2A30+CESHrjHB/miS NXWGePk0v4GGbVROt9ujBbbh9iQkREgCAei6Orx2CtILIwbJux3LCmk3lI/GxSs8TzlFA9EWG 4+Kc2INJ3635Zby7BHe6QFAZU32Irl1vnB/yGz8LoYlavu0MeoZqOJDgEhWQq5Dr8Mf8l6sfi 3iySySZ1VchGaI9NaY7xiDUs64hZ1OLoJhcCiWVIFZ1UVGQxusHB9nMzFAIBwHrRom+vYZyZr 537Gc02wF5cuDSgO3+r0QKqcoxNwmOw2DtZ0sVozrv2as1GfkwLSvGPSGwZIg5mv/B/0m0PKf l4vqtfzP8Ul3GTaSB2H5Na8UzyfphpQqzY6qPJfNZJkMatUHm31vl0mfNzfF+TUsU1ahG0bK6 amT0F96QGKV7nwQOWA28vreEL3ZSmTY2hN7ze1nfm57SIgvvJX136uCrCAyMPcsnE+yFW9Yne DWR3DZYu9mtTXYgTLppdaJQK1xsRnDE42kwniGwtD3pJtIjZSdP8StrrfrrTd1TC25DUvRAd2 H5jhq38bnj58x75iXeyvq9ytGp3mfqD1nxhkJtvYZvxerHnAKp5J/9bfGjVDCMDcKB6I= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The s6e8ax0 suspend/resume functions are hidden inside of an #ifdef when CONFIG_PM is set to avoid unused function warnings, but they call some other functions that nothing else calls, and we get warnings about those: drivers/video/fbdev/exynos/s6e8ax0.c:449:13: error: 's6e8ax0_sleep_in' defined but not used [-Werror=unused-function] drivers/video/fbdev/exynos/s6e8ax0.c:485:13: error: 's6e8ax0_display_off' defined but not used [-Werror=unused-function] This marks the PM functions as __maybe_unused so the compiler can silently drop them when they are not referenced. Signed-off-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski --- drivers/video/fbdev/exynos/s6e8ax0.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/exynos/s6e8ax0.c b/drivers/video/fbdev/exynos/s6e8ax0.c index 95873f26e39c..de2f3e793786 100644 --- a/drivers/video/fbdev/exynos/s6e8ax0.c +++ b/drivers/video/fbdev/exynos/s6e8ax0.c @@ -829,8 +829,7 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev) return 0; } -#ifdef CONFIG_PM -static int s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev) +static int __maybe_unused s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev) { struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev); @@ -843,7 +842,7 @@ static int s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev) return 0; } -static int s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev) +static int __maybe_unused s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev) { struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev); @@ -855,10 +854,6 @@ static int s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev) return 0; } -#else -#define s6e8ax0_suspend NULL -#define s6e8ax0_resume NULL -#endif static struct mipi_dsim_lcd_driver s6e8ax0_dsim_ddi_driver = { .name = "s6e8ax0", @@ -867,8 +862,8 @@ static struct mipi_dsim_lcd_driver s6e8ax0_dsim_ddi_driver = { .power_on = s6e8ax0_power_on, .set_sequence = s6e8ax0_set_sequence, .probe = s6e8ax0_probe, - .suspend = s6e8ax0_suspend, - .resume = s6e8ax0_resume, + .suspend = IS_ENABLED(CONFIG_PM) ? s6e8ax0_suspend : NULL, + .resume = IS_ENABLED(CONFIG_PM) ? s6e8ax0_resume : NULL, }; static int s6e8ax0_init(void)