From patchwork Fri Nov 20 21:48:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7671521 Return-Path: X-Original-To: patchwork-linux-fbdev@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 436DC9F1C2 for ; Fri, 20 Nov 2015 21:51:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 630202045B for ; Fri, 20 Nov 2015 21:51:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A74020458 for ; Fri, 20 Nov 2015 21:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761091AbbKTVvs (ORCPT ); Fri, 20 Nov 2015 16:51:48 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:53686 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761083AbbKTVvr (ORCPT ); Fri, 20 Nov 2015 16:51:47 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0M4kN3-1aIEjy3YUf-00z0Gg; Fri, 20 Nov 2015 22:48:39 +0100 From: Arnd Bergmann To: Tomi Valkeinen Cc: Jean-Christophe Plagniol-Villard , Sudip Mukherjee , Teddy Wang , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] fbdev: sm712fb: avoid unused function warnings Date: Fri, 20 Nov 2015 22:48:36 +0100 Message-ID: <4240710.SWINpxTKzN@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:TNIp++HSxosNt1mY7Y1rjINiDTB65Aqds3pXl//RfmqqmQ9ahjr l6GV9eHsWqcCfhq1iZzL1R4XFoq+hMOPH48IOewR3G5L28sdMb8cuzFFXmK4/sNa8LA6VTW PgKHgs2r8TKNMbFKf9XAOtY/Dfb9Q56U9qbS46+6zL9G+KAouL4kiwKhCKHPnSLWrxIEpr+ fLNXD7ViL2X3rFLA+WXSA== X-UI-Out-Filterresults: notjunk:1; V01:K0:KYMrdjRGwUU=:Xl2I5YI9D5nDaILUoVugSe DmNjkwiE2zRygOFD14tVxI4xY7kNWvMRyL1LwbK1Gtctp2ytcx+AQzrzIhD1oBcdPd/KpEfsj c6oD06YJZVB53EkAeCNohw9vhAvOMBB1RudO964EuK3nYjv2sXkMPl+6xdtXdixF/WFVn0BOm EJ3/n1PJNpmW5QF6apLf6L2+VHdfzC/ifyKuWUmKFG+h2QBYldyigi99XJ/9rULLDjucbqeG4 P0aHnWIyMaUeXWIZS6YaiK5Tg6cssrASYoHntqNNBRIzAQ4MqMq4MMmYsWw3Ht3T0ckdS51m1 WoNPpOTjVdz6E/JMC3KXBLxIavhgTTyhHRkGkqyy99jDsd1GVxqvrLy3QdCZ6UraO5qu/aymK GlUliZxJ9NEPFwd5wFIgVtWkC43ejDTFkQkQtTPeKw0TAy7wV98aE5OxykDZTI3MrqOJNxwL7 E/EhgTxIhFNtsNhj+/w96A/M/OAMWUto3/JI04rhelUXJv85v1yKGmjR9vEV6OeDlOwxY0S0h Pyf0KHc/ft6melG4nJ9JozWlYoew78sMR6e5dfpiat6uFzHZY8ZDbhuggnuG5uyu480Pdw7zW ddFCLyOMcoIK8UcCyewBOT0dH1h9hBlXtU8fFHazD160Fg1l99CXeibCOlBG6867sNqo4Cx+u Io9iTjXeJPycOrn48U4rwpHXaQePJhHIP8//OsB1QAviBYdx3dxGW9xe5Ysz/1JlHqgZ1cIq6 WaOCqtOJBdjOjGGe Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 sm712fb framebuffer driver encloses the power-management functions in #ifdef CONFIG_PM, but the smtcfb_pci_suspend/resume functions are only really used when CONFIG_PM_SLEEP is also set, as a frequent gcc warning shows: fbdev/sm712fb.c:1549:12: warning: 'smtcfb_pci_suspend' defined but not used fbdev/sm712fb.c:1572:12: warning: 'smtcfb_pci_resume' defined but not used The driver also avoids using the SIMPLE_DEV_PM_OPS macro when CONFIG_PM is unset, which is redundant. This changes the driver to remove the #ifdef and instead mark the functions as __maybe_unused, which is a nicer anyway, as it provides build testing for all the code in all configurations and is harder to get wrong. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index 629bfa2d2f51..86ae1d4556fc 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -28,9 +28,7 @@ #include #include -#ifdef CONFIG_PM #include -#endif #include "sm712.h" @@ -1545,8 +1543,7 @@ static void smtcfb_pci_remove(struct pci_dev *pdev) pci_disable_device(pdev); } -#ifdef CONFIG_PM -static int smtcfb_pci_suspend(struct device *device) +static int __maybe_unused smtcfb_pci_suspend(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct smtcfb_info *sfb; @@ -1569,7 +1566,7 @@ static int smtcfb_pci_suspend(struct device *device) return 0; } -static int smtcfb_pci_resume(struct device *device) +static int __maybe_unused smtcfb_pci_resume(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct smtcfb_info *sfb; @@ -1610,20 +1607,13 @@ static int smtcfb_pci_resume(struct device *device) } static SIMPLE_DEV_PM_OPS(sm7xx_pm_ops, smtcfb_pci_suspend, smtcfb_pci_resume); -#define SM7XX_PM_OPS (&sm7xx_pm_ops) - -#else /* !CONFIG_PM */ - -#define SM7XX_PM_OPS NULL - -#endif /* !CONFIG_PM */ static struct pci_driver smtcfb_driver = { .name = "smtcfb", .id_table = smtcfb_pci_table, .probe = smtcfb_pci_probe, .remove = smtcfb_pci_remove, - .driver.pm = SM7XX_PM_OPS, + .driver.pm = &sm7xx_pm_ops, }; static int __init sm712fb_init(void)