From patchwork Wed Mar 2 15:58:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102622 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2460419lbc; Wed, 2 Mar 2016 08:01:02 -0800 (PST) X-Received: by 10.66.233.194 with SMTP id ty2mr39043109pac.126.1456934461552; Wed, 02 Mar 2016 08:01:01 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si58979015pfa.129.2016.03.02.08.01.01; Wed, 02 Mar 2016 08:01:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932130AbcCBQAv (ORCPT + 30 others); Wed, 2 Mar 2016 11:00:51 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:52800 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755070AbcCBQAq (ORCPT ); Wed, 2 Mar 2016 11:00:46 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0LmNdq-1a1XSC2NkI-00ZuDD; Wed, 02 Mar 2016 16:59:46 +0100 From: Arnd Bergmann To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/14] power: ipaq-micro-battery: use __maybe_unused to hide pm functions Date: Wed, 2 Mar 2016 16:58:55 +0100 Message-Id: <1456934350-1389172-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:9q0TQVdWAXmQ+WcgleRqY3bgCpM1ckmFJkLDZtzCmGsKcWPLniu Vx2qYMzUdxIF+tNjdyPkiMdbuPmadM+KwnOYt37txpuHWwrKKgDn6y+ZSfwxc6YKd99OPPh ZL58shI2env8roSbw79NPhmQ2fNemn3cF07xNwxss/vpYH75Zth+BVrhNBm1kifmTQdRhir KTVS/n7h88fbwg8RL2Rbg== X-UI-Out-Filterresults: notjunk:1; V01:K0:LjlzcNQI8PU=:H6X/lg787c8KXVqVSaXWnD SmWa2qZSuEc5XUPpkaSwXQyVozEUHEti9WcyIBBWt8DEpffasPS9kzkzZJgAse50Ixx5KbCVb oSaaUDvzqk/QhuJRtBbOaF7E+vENXDoirX5qRrPcl8ijVJ+y1X2hJo2+9y+VxQi/AyA8igYtS MqjPPwlM8jmGiYrA+EJVP0XIpcv/79ogXGgw2NIpsZbFfjZuB7BTSMoyRw87emf6md2NvIusT R9e/aKRpgDWClHy7wR4A+SFzJbkrPuvprpNLc717o9+AVcyV/trGigGynQ+AQsvO/ckLCWhKf WombwPW5MNiS5hRKvmL87pw+OIncv1r2U5NBHvkFDWtueI5ZsicPNKzObxufH4Wf/DpnJadab HO9X6CA4VONpE1Yn8WPde7aPhdSkKp3p6YY+/S54WMsqI4Mx5Ef2n3jSPKWZTSd5nJ64UYE4p fI9Sngp+uL+Av1hQNgzObaLhFKiMFyiNVsSL6ZrV3kK3f69ACO/Mw0wlo+nL9nunAqPD62e1S DVV3oh1SM4IR8N+VUPeryBSZJ+OvYf6TdGWjZQe21FoB18u6cPJK6ha+t0X0XIqRFKr9KOjUY GQyFw5HxGrZLTjqNQHasNHix7xeZ9TPeP8UjV2q7eIlpNckqCj7g59M9kD4Karx7wJktngSRA VD3gyvEPC+gVyKFCGnZWuYpKDuJLddBHsBY+k0lr0tnGpBAiwvFZDtwRygDhY2MB+hKA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ipaq micro battery driver has suspend/resume functions that are accessed using SIMPLE_DEV_PM_OPS, which hide the reference when CONFIG_PM_SLEEP is not set, resulting in a warning about unused functions: drivers/power/ipaq_micro_battery.c:284:12: error: 'micro_batt_suspend' defined but not used [-Werror=unused-function] drivers/power/ipaq_micro_battery.c:292:12: error: 'micro_batt_resume' defined but not used [-Werror=unused-function] This adds __maybe_unused annotations to let the compiler know it can silently drop the function definition. Signed-off-by: Arnd Bergmann --- drivers/power/ipaq_micro_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0 diff --git a/drivers/power/ipaq_micro_battery.c b/drivers/power/ipaq_micro_battery.c index f03014ea1dc4..3f314b1a30d7 100644 --- a/drivers/power/ipaq_micro_battery.c +++ b/drivers/power/ipaq_micro_battery.c @@ -281,7 +281,7 @@ static int micro_batt_remove(struct platform_device *pdev) return 0; } -static int micro_batt_suspend(struct device *dev) +static int __maybe_unused micro_batt_suspend(struct device *dev) { struct micro_battery *mb = dev_get_drvdata(dev); @@ -289,7 +289,7 @@ static int micro_batt_suspend(struct device *dev) return 0; } -static int micro_batt_resume(struct device *dev) +static int __maybe_unused micro_batt_resume(struct device *dev) { struct micro_battery *mb = dev_get_drvdata(dev); From patchwork Wed Mar 2 15:59:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102621 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2460442lbc; Wed, 2 Mar 2016 08:01:04 -0800 (PST) X-Received: by 10.66.233.131 with SMTP id tw3mr40187286pac.89.1456934462313; Wed, 02 Mar 2016 08:01:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si58979015pfa.129.2016.03.02.08.01.02; Wed, 02 Mar 2016 08:01:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932173AbcCBQAy (ORCPT + 30 others); Wed, 2 Mar 2016 11:00:54 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:61285 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbcCBQAv (ORCPT ); Wed, 2 Mar 2016 11:00:51 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MP2NL-1aUpng2zwd-006KYI; Wed, 02 Mar 2016 17:00:19 +0100 From: Arnd Bergmann To: Solomon Peachy , Kalle Valo Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/14] wireless: cw1200: use __maybe_unused to hide pm functions_ Date: Wed, 2 Mar 2016 16:59:02 +0100 Message-Id: <1456934350-1389172-11-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:p8aMqJH87b5UuRBZKNODGj92QwY6n6rwjL6oo5bNnLsg6a2E9B0 a4Tc3dAH0dbt33IwrzZm+/CVwQ4x+3GOnxrCycovCxmZRXrBQNLjjI2rzauzM+t1DDhZMDa +NCQkC+EYXnyCvPScAeWvkxrjFaOTzLbCb8KnQ3GS660ToLZYuzvfHHeHhErzvJbEfxIO78 iAlAuaX+Jx/NvQotJIvwg== X-UI-Out-Filterresults: notjunk:1; V01:K0:tGATYwamzD4=:AVDVANBco9LTxvivPYEQrO s+j8NhDNVS+IpUloqna98rShdLuUBRztSR6YSQlP4exJpPfggJJD3dhi0dgRslTZYWlJ61//I o4Jsmfq6/PXAnqlSYAKZ3O0BNZfLcjzPyniLdgfD5ZAFerOtjaGffH2oO9wx6czaBA5QZhsT7 9tFAEwzAWlsf7trpfrqzw89nYpcRyHi6nvKudzPrG5tA80/0epAAmfAteFFMhwE35ajp27dPK fxJOvxjNYt3NbQj6kTUTSMCzg6eWnXMf7xP0szcxHasl03a+b3Z1p0fB2MT7cuJCWA8C47Lx2 mOu8/Da5nU90sjWDXQurVbF8des9cEWKMibZwfNsivjhsLEJdRHKxUZ0qUc61iL3DWqKZ8v1A NQs03pOZB8oKA6vEe0kUto27g44jEtOj6GfydK4PyGrxq515I0L8nsiFZbqmz1vZxkjEMl2W0 ZPRBDlln6UO0kX/ixv6VcFITsFRDWt4PmapPGs5eOYM8f0VvBQGKnlxlIl74W4M9pAuKbv7lJ +YIfq7g9FioYNov23Of2zzKpQD6SzO2C9FnfGZpzy4hONKeHOPBapm2XyrUFUwN2qliBY9IED pa1NbGK0XrQDK5RLJQ72igW97J+AdolD6PBeLwV94tL93E+o7I0HEMXIsYETgmowjNZXtQJRN QFrn9O/3Ep19muGOzYgR+HRp9qLAyGMXL65jlNU4KFM2LOzNxqhu9rcBTScxhkt6jXng= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cw1200 uses #ifdef to check for CONFIG_PM, but then uses SIMPLE_DEV_PM_OPS, which leaves the references out when CONFIG_PM_SLEEP is not defined, so we get a warning with PM=y && PM_SLEEP=n: drivers/net/wireless/st/cw1200/cw1200_spi.c:450:12: error: 'cw1200_spi_suspend' defined but not used [-Werror=unused-function] This removes the incorrect #ifdef and instead uses a __maybe_unused annotation to let the compiler know it can silently drop the function definition. For the DEV_PM_OPS definition, we can use an IS_ENABLED() check to avoid defining the structure when CONFIG_PM is not set without the #ifdef. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/st/cw1200/cw1200_spi.c | 9 ++------- drivers/net/wireless/st/cw1200/pm.h | 9 +++++++-- 2 files changed, 9 insertions(+), 9 deletions(-) -- 2.7.0 diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c index a740083634d8..63f95e9c2992 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c @@ -446,8 +446,7 @@ static int cw1200_spi_disconnect(struct spi_device *func) return 0; } -#ifdef CONFIG_PM -static int cw1200_spi_suspend(struct device *dev) +static int __maybe_unused cw1200_spi_suspend(struct device *dev) { struct hwbus_priv *self = spi_get_drvdata(to_spi_device(dev)); @@ -460,16 +459,12 @@ static int cw1200_spi_suspend(struct device *dev) static SIMPLE_DEV_PM_OPS(cw1200_pm_ops, cw1200_spi_suspend, NULL); -#endif - static struct spi_driver spi_driver = { .probe = cw1200_spi_probe, .remove = cw1200_spi_disconnect, .driver = { .name = "cw1200_wlan_spi", -#ifdef CONFIG_PM - .pm = &cw1200_pm_ops, -#endif + .pm = IS_ENABLED(CONFIG_PM) ? &cw1200_pm_ops : NULL, }, }; diff --git a/drivers/net/wireless/st/cw1200/pm.h b/drivers/net/wireless/st/cw1200/pm.h index 3ed90ff22bb8..534548470ebc 100644 --- a/drivers/net/wireless/st/cw1200/pm.h +++ b/drivers/net/wireless/st/cw1200/pm.h @@ -31,13 +31,18 @@ int cw1200_pm_init(struct cw1200_pm_state *pm, void cw1200_pm_deinit(struct cw1200_pm_state *pm); int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); -int cw1200_wow_resume(struct ieee80211_hw *hw); int cw1200_can_suspend(struct cw1200_common *priv); +int cw1200_wow_resume(struct ieee80211_hw *hw); void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, unsigned long tmo); #else static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, - unsigned long tmo) { + unsigned long tmo) +{ +} +static inline int cw1200_can_suspend(struct cw1200_common *priv) +{ + return 0; } #endif #endif From patchwork Wed Mar 2 15:59: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: 102620 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2460549lbc; Wed, 2 Mar 2016 08:01:14 -0800 (PST) X-Received: by 10.98.42.150 with SMTP id q144mr39803626pfq.73.1456934474277; Wed, 02 Mar 2016 08:01:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vy6si58877534pac.31.2016.03.02.08.01.13; Wed, 02 Mar 2016 08:01:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932190AbcCBQBK (ORCPT + 30 others); Wed, 2 Mar 2016 11:01:10 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:55997 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753419AbcCBQBA (ORCPT ); Wed, 2 Mar 2016 11:01:00 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MWySC-1aMxrz0CkW-00W0Oz; Wed, 02 Mar 2016 17:00:27 +0100 From: Arnd Bergmann To: Dmitry Torokhov Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Rajeev Kumar , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/14] input: spear-keyboard: use __maybe_unused to hide pm functions Date: Wed, 2 Mar 2016 16:59:03 +0100 Message-Id: <1456934350-1389172-12-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:cXpHE511VTAACJgpSUUzCz+UKuc5TrrE4SET7wGLH2/85aUpepI 2XqjxrM0YCeR9ZmqJB0AC3zNllHj4hFvzEteEr49K/NY0PvilSkgvCcFz8uPpD0YUFKdXSH /3fCe2v3XhQx/AdN4F09j3R7G4/YN8QteyRhkC/w+Fa0R84j4sPzpbWNjsYy+79WpMBYgwD z7gX7TAF92zPcjp259OmA== X-UI-Out-Filterresults: notjunk:1; V01:K0:WTYEQr2FlPc=:O7uIr3z0CI9mfWyq+oqHn3 MncfKQryBohjBwN1gR3PnfE3mHd/DlkYXJQUUImzQJx4JSLMKlq2FAu8PLXWv838qG6x0jCPZ CW3b7YzZi3QQEWsytsJffSUH1wz0ZRDPcA5Il/znk45sUZ8d1uhvw6fU6NoioVvOM4PvuxUVk LEIOvm+ClqieZZOQmOtz6TE6QBj39xWGrCGdlaZf6wFRuVqCbb6HvC3z6FM3lSOxSHK1nCr+k n8BQOigT+GJ6SK5UHRxzSzyBB0AsAhhuTB/IuF9ZNP8L8fEpsikYroLVEK2INejG0JpLUnOla 0K2glTx/z9abtXtixb0iDBj+5RQ9IhecyXqC4W69aFjvohazUuIx8Fxi/Uo/sS1Nnfj8tKAsd OroNd1ZMEMlCIY/pf1CuxYC+vYWh8OoH25wxjIspb81pvZVi/HMMk2NhIm2xb5FHpigbLSZi4 ZhSF6MRHOEyi45iWbB/pY19okYxmbybFjyH0YWBUQzDxjCV14oqJohlkEUhFmlT77JvNyqStT MiFFSiuX2hdOL5kTpsLbpu1gPwAR1w1K9BU5jfUUCUy5fNU5tGEqETqufl4xLqkCI5+MNH+nW E2UB61BYKO3d5O7INk0chHry99AG8DMAMvif9qQ33OkFw5OgNVjOZnFzIfkrOQiqS9j5BfEPk hhyyup3jSrTkYRh0FAdzDTbJop8Ic0SI7ws00HcKcFWSyOqCNuIUs17USxx5/h3qnESE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The spear keyboard driver uses #ifdef CONFIG_PM to hide its power management functions, but then uses references from SIMPLE_DEV_PM_OPS that are only present if both CONFIG_PM and CONFIG_PM_SLEEP are set, resulting in a warning about unused functions: drivers/input/keyboard/spear-keyboard.c:292:12: error: 'spear_kbd_suspend' defined but not used [-Werror=unused-function] drivers/input/keyboard/spear-keyboard.c:345:12: error: 'spear_kbd_resume' defined but not used [-Werror=unused-function] This removes the #ifdef and instead uses a __maybe_unused annotation. Signed-off-by: Arnd Bergmann --- drivers/input/keyboard/spear-keyboard.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 623d451767e3..8083eaa0524a 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -288,8 +288,7 @@ static int spear_kbd_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int spear_kbd_suspend(struct device *dev) +static int __maybe_unused spear_kbd_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct spear_kbd *kbd = platform_get_drvdata(pdev); @@ -342,7 +341,7 @@ static int spear_kbd_suspend(struct device *dev) return 0; } -static int spear_kbd_resume(struct device *dev) +static int __maybe_unused spear_kbd_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct spear_kbd *kbd = platform_get_drvdata(pdev); @@ -368,7 +367,6 @@ static int spear_kbd_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume); From patchwork Wed Mar 2 15:59:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102614 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2461476lbc; Wed, 2 Mar 2016 08:02:45 -0800 (PST) X-Received: by 10.66.146.39 with SMTP id sz7mr39980463pab.76.1456934565788; Wed, 02 Mar 2016 08:02:45 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si34827304par.57.2016.03.02.08.02.45; Wed, 02 Mar 2016 08:02:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755876AbcCBQCi (ORCPT + 30 others); Wed, 2 Mar 2016 11:02:38 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:59434 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932095AbcCBQAu (ORCPT ); Wed, 2 Mar 2016 11:00:50 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0Lfp8c-1a8B6V2pb8-00pKXD; Wed, 02 Mar 2016 17:00:37 +0100 From: Arnd Bergmann To: Dmitry Torokhov Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Shawn Guo , Robin Gong , Javier Martinez Canillas , Frank Li , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/14] keyboard: snvs-pwrkey: use __maybe_unused to hide pm functions Date: Wed, 2 Mar 2016 16:59:04 +0100 Message-Id: <1456934350-1389172-13-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:JTPlhiyb0sF3yicLhs9Ck0Ze0x/SK8Fob0OYaZ6dYSxmmnFDXE+ U7tMOLijtgo8PBdB9b6akLnnLHmXBhL1SH3491yuIOlhG2WgCb5yvUud076VFw/qXezdZRK TloNGrmpaoJiJU4fib2VoeKVvVb+S6h+eSew9T1BGBITbWBFps2hoa03U0/CYCI6ZKikHuc unhHT6rr9IXmfl+zdkxFw== X-UI-Out-Filterresults: notjunk:1; V01:K0:uE/2jO2dkPI=:ZW6WHiVSCdE4bXvBFo96HD u475MErREkcoHpPhI77ZNxqPUualcGrLu4nm1d6Uvp4e0TJJnE5E13gXCRv2vHRgrg/CadXAk 9z1O0MqpAoNTLF/P7LitYXCUuWxBk1FOVcTFc1tHbCc/ed7/i/E8uGmqD9pOCxQSGmh4YcrLw wk7P9mdZr2dESZdVqcyLMXeNPFjoWCYRgnfRcJUwaiZr8kvfZj4fXhwy8J+OKuEKu5r8Yhw3c OheQY6xzNF50wtALZoLnHtVWkdNP6oOSRW7Pou9NHUeiZpU6gTq2bWZ9JiAgjQVc8ZQ1jHUzj OwOvzgQXCSNiA4x+/JxttfEbctxKQon+III6+hSjnsu/4wyShXm2OlwxlIUbe2G+tjDkgEnph /AqemQ5A14pluykfSK2JyZdhRcKXm+7Xm03Nyc16ODWlqNLDHdGuEu3Hk8EzLp1MEMn7c3Qs7 YOlbsYTn3IdZr0IPhb6/EPuQQ+HqHyPj+3P0kxOfL7jZFxTH0ojj2YEuGkXqB1ZVbglxsMIpO wNUJBpD8H31oGpfE2hPX5jc3hcYK6/dAWhOTFbUxJLyjM+HOn3S2VPK85YI37tP3E7fBQbvtF 0hZ6+69gvLPD51afigFPOdPmvlrBpH/jnClcImQ9luDhW3fVcN1NmOcRe5IHFxmT0pjmm3v3a +JOpOkhq7kzKilGseK4Wdt1R4GWfRrY1UCev3lZvmWIY6UjVW9FFyuyQJUuf6kRsbkV0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SNVS power key driver has suspend/resume functions that are accessed using SIMPLE_DEV_PM_OPS, which hide the reference when CONFIG_PM_SLEEP is not set, resulting in a warning about unused functions: drivers/input/keyboard/snvs_pwrkey.c:183:12: error: 'imx_snvs_pwrkey_suspend' defined but not used [-Werror=unused-function] drivers/input/keyboard/snvs_pwrkey.c:194:12: error: 'imx_snvs_pwrkey_resume' defined but not used [-Werror=unused-function] This adds __maybe_unused annotations to let the compiler know it can silently drop the function definition. Signed-off-by: Arnd Bergmann --- drivers/input/keyboard/snvs_pwrkey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0 diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c index 9adf13a5864a..b0ffadeb208c 100644 --- a/drivers/input/keyboard/snvs_pwrkey.c +++ b/drivers/input/keyboard/snvs_pwrkey.c @@ -180,7 +180,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) return 0; } -static int imx_snvs_pwrkey_suspend(struct device *dev) +static int __maybe_unused imx_snvs_pwrkey_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); @@ -191,7 +191,7 @@ static int imx_snvs_pwrkey_suspend(struct device *dev) return 0; } -static int imx_snvs_pwrkey_resume(struct device *dev) +static int __maybe_unused imx_snvs_pwrkey_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); From patchwork Wed Mar 2 15:59:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102610 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2462563lbc; Wed, 2 Mar 2016 08:04:38 -0800 (PST) X-Received: by 10.67.7.197 with SMTP id de5mr39967774pad.105.1456934678655; Wed, 02 Mar 2016 08:04:38 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si58988955pfj.20.2016.03.02.08.04.38; Wed, 02 Mar 2016 08:04:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756541AbcCBQEa (ORCPT + 30 others); Wed, 2 Mar 2016 11:04:30 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:62982 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756347AbcCBQAq (ORCPT ); Wed, 2 Mar 2016 11:00:46 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0Lsw94-1Zv1xi1Yl8-012cCJ; Wed, 02 Mar 2016 17:00:40 +0100 From: Arnd Bergmann To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/14] [media] omap3isp: use IS_ENABLED() to hide pm functions Date: Wed, 2 Mar 2016 16:59:05 +0100 Message-Id: <1456934350-1389172-14-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:fWaIY3IYoq1zj7EM1WmCExFOjpV99OMcIx/S13lIIO0+m6u4SFM q2TF1C17fhFRUIM4LgEv4Fp3qCE/oeCzK7nSb0W7pW2+cS++cmyYMwZEKTD7tA1SSfCMvLP KgStj8phPj+5lvjw6dCch5u8wf3UyKHWrjZnWZN89qB/7pvfmdv3RySxKc4UXHhKE+7nQXn KtUb7fOm5VNZSzRnvmVyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:c0M1v7BH9Zg=:PDmcsHgbus/0c8z2k7+pxa 8ME/8E1z+yO78DBBoTz3SUpwFCW2VtoDxgnFAM7NzrBLtIL+buSWpoPOwBl9tZz1zHJsQ1OhI XtyYR3qiTkh4leSYZHbo/08j0cQ6nCkgCyp568S+JInwTVvp4zBeohK2Tijr7raM0fE0yGlAa tQL/rnrUTJp4Vu7S43DJyA8NlhkspBEYCvsQIwgDPTx/T1rJnsF+lPO03bknrDoQDA2rVwY0S KyHJZvhMo1O4o/tPkwbqADMXe0FBPO0AePvEsjB1b0Ahv+VR34dsl4FuYU/uvK9khsRKSgvzM 5Pe70a7XtANhQEp66njTJOsQT87BZjOKHelfcukn4ArtR1WmRvE2FvuwkB0qzgMeVQpGJPez5 +IDj92GDVIkIQzL0abxCwpcxBoEE1VEL02bHwsKGu7wpJ9IINXBqaxtVOMiJiZvi6peS+mzhB fBKtoOtPHnS/Id90GKPR1fLERKMg36i3i1ZKxgRISIMyyNo62+PQdrchvVlCDoiszi7jjVA42 skVFJoeDZP3HjTjR+/owNH5EaiTx9NGXk31xwoqfjSVPSPLFkgzSHEUbV1ylxkqQcaDzs9Eda srRb7965WIKoAqphGqLCTbJVR6dQrxeCx88NUo1of2SaZkOVHRJ9vuf+71Qwm1bsRuOhLuZdA vaWiDpugVqAViKQH86bbIAilmiwJf+i7PbwaFZ0/D+GgZ4nq6iEaE5dUcwjehTPXiMPU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The omap3isp driver hides is power management functions using #ifdef but it fails to hide the isp_suspend_modules/isp_resume_modules functions in the same way, which leads to a build warning when CONFIG_PM is disabled: drivers/media/platform/omap3isp/isp.c:1183:12: error: 'isp_suspend_modules' defined but not used [-Werror=unused-function] drivers/media/platform/omap3isp/isp.c:1217:13: error: 'isp_resume_modules' defined but not used [-Werror=unused-function] As the driver manually defines its dev_pm_ops structure and all members are NULL without CONFIG_PM, we can simply avoid referencing the structure using an IS_ENABLED() check, and drop all the #ifdef to avoid all warnings. Signed-off-by: Arnd Bergmann --- drivers/media/platform/omap3isp/isp.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) -- 2.7.0 diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index f9e5245f26ac..7f118baca270 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -1713,8 +1713,6 @@ void omap3isp_print_status(struct isp_device *isp) dev_dbg(isp->dev, "--------------------------------------------\n"); } -#ifdef CONFIG_PM - /* * Power management support. * @@ -1785,15 +1783,6 @@ static void isp_pm_complete(struct device *dev) isp_resume_modules(isp); } -#else - -#define isp_pm_prepare NULL -#define isp_pm_suspend NULL -#define isp_pm_resume NULL -#define isp_pm_complete NULL - -#endif /* CONFIG_PM */ - static void isp_unregister_entities(struct isp_device *isp) { omap3isp_csi2_unregister_entities(&isp->isp_csi2a); @@ -2611,7 +2600,7 @@ static struct platform_driver omap3isp_driver = { .id_table = omap3isp_id_table, .driver = { .name = "omap3isp", - .pm = &omap3isp_pm_ops, + .pm = IS_ENABLED(CONFIG_PM) ? &omap3isp_pm_ops : NULL, .of_match_table = omap3isp_of_table, }, };