From patchwork Fri Aug 26 15:31:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101924 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp414225qga; Fri, 26 Aug 2016 08:32:29 -0700 (PDT) X-Received: by 10.66.150.202 with SMTP id uk10mr7179783pab.10.1472225549898; Fri, 26 Aug 2016 08:32:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hm6si21703900pac.254.2016.08.26.08.32.28; Fri, 26 Aug 2016 08:32:29 -0700 (PDT) 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 S1753733AbcHZPcL (ORCPT + 27 others); Fri, 26 Aug 2016 11:32:11 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:62040 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753029AbcHZPcI (ORCPT ); Fri, 26 Aug 2016 11:32:08 -0400 Received: from wuerfel.lan. ([176.0.135.42]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LfznH-1bKStE0QLz-00pgAr; Fri, 26 Aug 2016 17:31:39 +0200 From: Arnd Bergmann To: Linus Walleij , Jonathan Cameron Cc: Arnd Bergmann , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: magn/ak8974: avoid unused function warning Date: Fri, 26 Aug 2016 17:31:19 +0200 Message-Id: <20160826153137.701672-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:cmC/ai1xI5pA+l6S/u9+eh9JXiV4i7gVDu6VA4dbtZKV9jSi3mB WYNhzQ26gaj8H3vqCgbA+kiKeOgd+A+ezSwJUZlXDhldmYjThkGS3FWkGZGowLgJuXaBBQv eRKqWwcYECGVAGgMgah0b2EyHetyFfUvpsGCXMgAgyK302iw5TEoHq/J/UYpJEm5IZAcCQJ u7ZJhpPD2ih+gFGSQXoEw== X-UI-Out-Filterresults: notjunk:1; V01:K0:UiOifruTBm4=:0MzzmHnV+T7xrB9z+c06LQ CitsbtZLOCQSI8YfbsepdDOxn7lFhB8ICC0vGrku92YVeyZSDhZGJdY0gISFdigTqoBnfMWg+ GzxQYJsOf3ewlVihGawM8sP0kzxk36qyFdFLPLdVXfiP9/E8k2fHldHN4ZDd3DG9PVNttJRDY Cb7U/nX4ksrKKyNts6XdF+OivHfyoeQX4IRe2j/aaU+UJte1XFmk3Ir1axTD7VIbgbKyVePZ8 vBH71n9u1QAyx+4LPBdj90eV5QNND29YDAmde7a7VY+D7Ai6P05LoCaAEaGff2R+ItlZ2lQX0 KfCEq9N5hWCt1aTjODnXyiiGqEjEtpKKc0xVkncVrQ6ZiOuV7TRrQ+xhpTEYHOuBMFBqHOyp+ r/zj99czu8hN2HIKWntwvq0V03gPSYTl6cqJzxAsGBzUvxloM+Lx7huK8pG66lpH9FAa/ewQC hxZs00IKPotgJebACJpeS+TulmpWhfImdywMeiB9mO6jzMZge08R4Aem7sKiNdRL+nmRlbRXC rTLb1snWxKWCfO8QQwQL86tvUrE9W4TcxJZjDd3sI8E+oIpdD0QgheNPpOoYAUix+9wTlHm4K iC16NO90OXk7I6lF/WtOlELNDeDIdfi6jX+9ru2d/wzA/iXb5S4yEyk6ThjrpO7B0FB67cEnR FXLzBGKF46Zrb0Y9FW3RNtnwLWDFts2y6f7MP89rMQvP3ulrHVABTZ9nVMIjBx9S7wcA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ak8974_configure() function is used only from the PM code, but that can be hidden when CONFIG_PM is disabled: drivers/iio/magnetometer/ak8974.c:201:12: error: 'ak8974_configure' defined but not used [-Werror=unused-function] This replaces the #ifdef with a __maybe_unused annotation, which will work correctly in all configurations and avoid the warning, as the compiler can now see where ak8974_configure is called from. Signed-off-by: Arnd Bergmann Fixes: 7c94a8b2ee8c ("iio: magn: add a driver for AK8974") --- drivers/iio/magnetometer/ak8974.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index e70e4e22b72c..12bd17b4cf58 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -783,8 +783,7 @@ static int __exit ak8974_remove(struct i2c_client *i2c) return 0; } -#ifdef CONFIG_PM -static int ak8974_runtime_suspend(struct device *dev) +static int __maybe_unused ak8974_runtime_suspend(struct device *dev) { struct ak8974 *ak8974 = iio_priv(i2c_get_clientdata(to_i2c_client(dev))); @@ -795,7 +794,7 @@ static int ak8974_runtime_suspend(struct device *dev) return 0; } -static int ak8974_runtime_resume(struct device *dev) +static int __maybe_unused ak8974_runtime_resume(struct device *dev) { struct ak8974 *ak8974 = iio_priv(i2c_get_clientdata(to_i2c_client(dev))); @@ -822,7 +821,6 @@ out_regulator_disable: return ret; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops ak8974_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,