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: 8112011 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6ED48BEEE5 for ; Mon, 25 Jan 2016 16:45:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78428202E6 for ; Mon, 25 Jan 2016 16:45:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C5F0201B9 for ; Mon, 25 Jan 2016 16:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933283AbcAYQpL (ORCPT ); Mon, 25 Jan 2016 11:45:11 -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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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=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 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(-) 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);