From patchwork Mon Jan 25 16:44:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101102 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1466574lbb; Mon, 25 Jan 2016 08:45:19 -0800 (PST) X-Received: by 10.98.32.25 with SMTP id g25mr27270256pfg.20.1453740319204; Mon, 25 Jan 2016 08:45:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp7si34682591pab.66.2016.01.25.08.45.16; Mon, 25 Jan 2016 08:45:19 -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 S933395AbcAYQpN (ORCPT + 30 others); Mon, 25 Jan 2016 11:45:13 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:57545 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933215AbcAYQpH (ORCPT ); Mon, 25 Jan 2016 11:45:07 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0MKyv2-1aNkFk2SyO-0000Yb; Mon, 25 Jan 2016 17:44:32 +0100 From: Arnd Bergmann To: Zhang Rui , Eduardo Valentin Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, spear-devel@list.st.com, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] thermal: spear: use __maybe_unused for PM functions Date: Mon, 25 Jan 2016 17:44:10 +0100 Message-Id: <1453740264-1972562-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453740264-1972562-1-git-send-email-arnd@arndb.de> References: <1453740264-1972562-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:ISgH7xm9zOWbsR1nJmieQszt4YFuQu1kMuHPFjPt6wm/iASqR5q uju87MB+5cK8LEZS97mMv2OxeThyAhHvkYqNOXJZEIhkoRuTI28nuui8bJ/6H0yw+CFFW9p YRtKivWw6qETv8qogd6wu/kmuFpKhGFIl+Ajhyr+0SrLM2+qxXcf7dlWbBv+yF7WgIXrqdj z8T2iLfroQMAPDiJxfQnw== X-UI-Out-Filterresults: notjunk:1; V01:K0:OxqNqhCnftg=:7XEa93WCSatsUwgzx6o1Eo PCksaO0NksDjjFGR4FIV+lMGkgV0Z2xXRDvpgCPo4992G3F2sd+LZVLMDBXM0hShpNLZgV9yX i8paRiP7MKdLQjgp0aKbq15GilTFhPTmoTzku2O4eTc0X/J9m0WIPqJlUt/Hy//t+CrYqJA/P Qe9+SnZSwXHdKpyfEGzcbWrOqfDc/7cVxrijZRUbSzWWkmokVwsWrisWilF3lMsrReenCJ8bG um8Ycl/QNYits0weaTyaHdc6pBYv4jdMldGgBpoTJMToLkm2IkgtfBwQKrl+3DZyEzA/ysq+8 cLYCxLCLckDhwDESQIKBDnqNBeSuUvjHjsBIX0TqHIhjBIox0rPdGKCghYbzkBwmy8Tc4kncg A2nVGUFqsS5wsjLX0nZyQWPCAjPTzn2Gip85Xh578w9bMOh5HCIy57KSBsPQTl5tHJWBmQgi7 GOXfDCdZhszHMx++JeqFr2YEPp62VLrBfBpGBoCCjDWlrxMOAj5y6W0gMW7yiuyDJI4mu0Pqt 9/aj5yaqDVjVb7fYd0w/bqpN26Gh9dnBGyQJPTaXTYj9lV9SsRktyjHP2zkJMLp7LWX6ISRC7 uCoaYwT5RUdrc0pPdmSGigTYqeYfVRbCFw4UgPQWngYJw71wcMAkNxCMX0OI8/lpkk4UXENte K47ZkWNsNBAuAk7qeCfXi28TcjFqJCbFsHCYjTy2PaSN/fCsM7mYPvVio1HPK5lIHjW4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The spear thermal driver hides its suspend/resume function conditionally based on CONFIG_PM, but references them based on CONFIG_PM_SLEEP, so we get a warning if the former is set but the latter is not: thermal/spear_thermal.c:58:12: warning: 'spear_thermal_suspend' defined but not used [-Wunused-function] thermal/spear_thermal.c:75:12: warning: 'spear_thermal_resume' defined but not used [-Wunused-function] This removes the #ifdef and instead uses a __maybe_uninitialized annotation to avoid the warning and improve compile-time coverage. Signed-off-by: Arnd Bergmann --- drivers/thermal/spear_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 534dd9136662..81b35aace9de 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -54,8 +54,7 @@ static struct thermal_zone_device_ops ops = { .get_temp = thermal_get_temp, }; -#ifdef CONFIG_PM -static int spear_thermal_suspend(struct device *dev) +static int __maybe_unused spear_thermal_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); @@ -72,7 +71,7 @@ static int spear_thermal_suspend(struct device *dev) return 0; } -static int spear_thermal_resume(struct device *dev) +static int __maybe_unused spear_thermal_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); @@ -94,7 +93,6 @@ static int spear_thermal_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(spear_thermal_pm_ops, spear_thermal_suspend, spear_thermal_resume);