lkml.org 
[lkml]   [2018]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] i2c: i801: fix unused-function warning
On Mon, May 14, 2018 at 12:33 PM, Anders Roxell
<anders.roxell@linaro.org> wrote:
> With CONFIG_PM, we get a harmless build warning:
> drivers/i2c/busses/i2c-i801.c:1723:12: warning: ‘i801_resume’ defined but not used [-Wunused-function]
> static int i801_resume(struct device *dev)
> ^~~~~~~~~~~
> drivers/i2c/busses/i2c-i801.c:1714:12: warning: ‘i801_suspend’ defined but not used [-Wunused-function]
> static int i801_suspend(struct device *dev)
> ^~~~~~~~~~~~

> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int i801_suspend(struct device *dev)

The better pattern is to get rid of ugly ifdef and supply
__maybe_unused annotation to each function in question.


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-05-14 19:20    [W:2.308 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site