[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb0e83e2f99aa066d40b3bb1c560486f0f278445.camel@perches.com>
Date: Wed, 28 Nov 2018 16:10:15 -0800
From: Joe Perches <joe@...ches.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
linux-rtc@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Mark Salyzyn <salyzyn@...roid.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-kernel@...r.kernel.org,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: Re: [PATCH v4 01/21] nvmem: Mark nvmem_type_str array with
__maybe_unused
On Wed, 2018-11-28 at 21:05 +0200, Andy Shevchenko wrote:
> Since we put static variable to a header file it's copied to each module
> that includes the header. But not all of them are actually using it.
>
> Mark nvmem_type_str array with __maybe_unused to make a compiler happy:
>
> In file included from include/linux/rtc.h:18,
> from drivers/rtc/rtc-proc.c:15:
> include/linux/nvmem-provider.h:29:27: warning: ‘nvmem_type_str’ defined but not used [-Wunused-const-variable=]
> static const char * const nvmem_type_str[] = {
It would be better to move this definition into
the one file that seems to use it.
$ git grep -w nvmem_type_str
drivers/nvmem/core.c: return sprintf(buf, "%s\n", nvmem_type_str[nvmem->type])
include/linux/nvmem-provider.h:static const char * const nvmem_type_str[] = {
Powered by blists - more mailing lists