lkml.org 
[lkml]   [2014]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] [linux-next] serial: sc16is7xx: f ix defined-but-not-used warnings
Date
Wed, 30 Apr 2014 15:07:04 +0200 от Jan Moskyto Matejka <mq@suse.cz>:
> drivers/tty/serial/sc16is7xx.c:1060:12: warning: 'sc16is7xx_probe' defined but not used [-Wunused-function]
> static int sc16is7xx_probe(struct device *dev,
> ^
> drivers/tty/serial/sc16is7xx.c:1176:12: warning: 'sc16is7xx_remove' defined but not used [-Wunused-function]
> static int sc16is7xx_remove(struct device *dev)
> ^
> drivers/tty/serial/sc16is7xx.c:1215:29: warning: 'regcfg' defined but not used [-Wunused-variable]
> static struct regmap_config regcfg = {
> ^
>
> Fixed these warnings by #ifdef-ing them to CONFIG_REGMAP_I2C and
> recursively #ifdef-ing also some other functions that got defined but not used.
>
> Signed-off-by: Jan Moskyto Matejka <mq@suse.cz>
> ---
> drivers/tty/serial/sc16is7xx.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index 7206a64..bd76277 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -389,6 +389,7 @@ static const struct sc16is7xx_devtype sc16is762_devtype = {
> .nr_uart = 2,
> };
>
> +#ifdef CONFIG_REGMAP_I2C
> static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg)

No. This is not a good way.
The Kconfig should be patched for dependency of I2C.

---

\
 
 \ /
  Last update: 2014-04-30 15:41    [W:0.033 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site