From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755565AbcH2Szb (ORCPT ); Mon, 29 Aug 2016 14:55:31 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:42677 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522AbcH2Sz3 (ORCPT ); Mon, 29 Aug 2016 14:55:29 -0400 Subject: Re: [PATCH] iio: magn/ak8974: avoid unused function warning To: Arnd Bergmann , Linus Walleij References: <20160826153137.701672-1-arnd@arndb.de> Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org From: Jonathan Cameron Message-ID: Date: Mon, 29 Aug 2016 19:55:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160826153137.701672-1-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/08/16 16:31, Arnd Bergmann wrote: > 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") Applied to the togreg branch of iio.git. Will be initially pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/magnetometer/ak8974.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > 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, >