lkml.org 
[lkml]   [2016]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] iio: magn/ak8974: avoid unused function warning
On Fri, Aug 26, 2016 at 5:31 PM, Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de>
> Fixes: 7c94a8b2ee8c ("iio: magn: add a driver for AK8974")

Nice catch!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.050 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site