From patchwork Fri Aug 26 15:30:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9301623 X-Patchwork-Delegate: geert@linux-m68k.org 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 90E03608A7 for ; Fri, 26 Aug 2016 15:32:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82F7329612 for ; Fri, 26 Aug 2016 15:32:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 748352951F; Fri, 26 Aug 2016 15:32:34 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 1FB932953E for ; Fri, 26 Aug 2016 15:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbcHZPcK (ORCPT ); Fri, 26 Aug 2016 11:32:10 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:56118 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbcHZPcI (ORCPT ); Fri, 26 Aug 2016 11:32:08 -0400 Received: from wuerfel.lan. ([176.0.135.42]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LvBCM-1avtas2R6I-010PNN; Fri, 26 Aug 2016 17:31:12 +0200 From: Arnd Bergmann To: "David S. Miller" , Sergei Shtylyov Cc: Arnd Bergmann , Yoshihiro Kaneko , Kazuya Mizuguchi , Simon Horman , Masaru Nagai , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ravb: avoid unused function warnings Date: Fri, 26 Aug 2016 17:30:29 +0200 Message-Id: <20160826153108.680850-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:dshNlFYuqDdyOFa5ts+T0hxuhpSUcKGcaOmbfPCKtrVaXMOpbO2 z5pX9typ/LWTY7tMJ50elvvsrDmY9cBeD3meTRDLunJ+zPzswab+WM2x46bwhaCWPONcdHb KKsBYMWr+5Z2dAx31BnpUjYFEeVBRQX5CJEkQro3f8qt3S/cXASeP+XPcUV/CAfkA28u60D 7WpI8MAEQ0RLFfX6/b8JQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:I3YIxJWJw4o=:jGEPfzddqH6Nx7dDz/5wEa RNXUC7oTiuzFN7qOrZDC18/CHPDg1ikJAoVKcUoT+lhPmyFiyiuCWVjnjgvXaDAXgHxraCceW Op8P+ydqFWinHwAA3VAubLLru3+L7yjpCRMXypKI3/6Rpr8dUObHIfJu3CoNDA/Aq3nYGNOlh reXQiJa04Iiq/Hq5sQKD5OjtqGl9gWXUW3a1eplHZ6RYSA7hMMw5Jz9twH3lyT/T29xAIw8lg EUzD4YGg4nX7jAzWFTzvIeWiCv5OTOARrE6SNAYEoBRl7o25Djoq2fkX2unF7wq6nq/ZUN4Gt 2Ft1XoTqFhMA0oHYX5y+Y8JlNdfX+K6fJt8/vZCszF8iGKcfdTuYfSMixRYtabfyvFXaqf0c2 yOFcxtvstBpmmEf4bFHV+LupiIdOIGz1rL3DpfTRkc78VC96+S8V4Ho/3zQMcTQcz3QV2ndOj jy4dCem+fDSsK+pTKMDo0416tVB1l+6YcTZcaOqIY1YTJOWrAyJAAYBZBeOANJQTAgDnh9aWQ 7AHbugC9H+i2NJMIZfs4X9+t/P81u4UlfJ26dhSrqjXsJh7Xjr/VrpPc5xMymPlcY3Nz2ZAbW xykDO+6bHIsj4wtWCl4EFpQa4vJw/eDmnKd2nseXmkefI96aA3mKupxOLvpWBsfTI/TK8IPQ8 s7qh7je9iQ6A+gD/X7rNt97V4RECukPSqyoERKWEuy47//ZxaKGjCDBnhLU2zc5ecHKc= Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_PM_SLEEP is disabled, we get a couple of harmless warnings: drivers/net/ethernet/renesas/ravb_main.c:2117:12: error: 'ravb_resume' defined but not used [-Werror=unused-function] drivers/net/ethernet/renesas/ravb_main.c:2104:12: error: 'ravb_suspend' defined but not used [-Werror=unused-function] The simplest solution here is to replace the #ifdef with __maybe_unused annotations, which lets the compiler do the right thing by itself. Signed-off-by: Arnd Bergmann Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support") Acked-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/ravb_main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index cad23ba06904..630536bc72f9 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2100,8 +2100,7 @@ static int ravb_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int ravb_suspend(struct device *dev) +static int __maybe_unused ravb_suspend(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); int ret = 0; @@ -2114,7 +2113,7 @@ static int ravb_suspend(struct device *dev) return ret; } -static int ravb_resume(struct device *dev) +static int __maybe_unused ravb_resume(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); struct ravb_private *priv = netdev_priv(ndev); @@ -2149,7 +2148,7 @@ static int ravb_resume(struct device *dev) return ret; } -static int ravb_runtime_nop(struct device *dev) +static int __maybe_unused ravb_runtime_nop(struct device *dev) { /* Runtime PM callback shared between ->runtime_suspend() * and ->runtime_resume(). Simply returns success. @@ -2166,17 +2165,12 @@ static const struct dev_pm_ops ravb_dev_pm_ops = { SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL) }; -#define RAVB_PM_OPS (&ravb_dev_pm_ops) -#else -#define RAVB_PM_OPS NULL -#endif - static struct platform_driver ravb_driver = { .probe = ravb_probe, .remove = ravb_remove, .driver = { .name = "ravb", - .pm = RAVB_PM_OPS, + .pm = &ravb_dev_pm_ops, .of_match_table = ravb_match_table, }, };