Skip to content

Commit a8b44d5

Browse files
andy-shevgregkh
authored andcommitted
nvmem: Move nvmem_type_str array to its only user
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. Move nvmem_type_str array to its only user 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[] = { ^~~~~~~~~~~~~~ Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Suggested-by: Joe Perches <joe@perches.com> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 611fbca commit a8b44d5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

drivers/nvmem/core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ static LIST_HEAD(nvmem_lookup_list);
6161

6262
static BLOCKING_NOTIFIER_HEAD(nvmem_notifier);
6363

64+
static const char * const nvmem_type_str[] = {
65+
[NVMEM_TYPE_UNKNOWN] = "Unknown",
66+
[NVMEM_TYPE_EEPROM] = "EEPROM",
67+
[NVMEM_TYPE_OTP] = "OTP",
68+
[NVMEM_TYPE_BATTERY_BACKED] = "Battery backed",
69+
};
70+
6471
#ifdef CONFIG_DEBUG_LOCK_ALLOC
6572
static struct lock_class_key eeprom_lock_key;
6673
#endif

include/linux/nvmem-provider.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ enum nvmem_type {
2626
NVMEM_TYPE_BATTERY_BACKED,
2727
};
2828

29-
static const char * const nvmem_type_str[] = {
30-
[NVMEM_TYPE_UNKNOWN] = "Unknown",
31-
[NVMEM_TYPE_EEPROM] = "EEPROM",
32-
[NVMEM_TYPE_OTP] = "OTP",
33-
[NVMEM_TYPE_BATTERY_BACKED] = "Battery backed",
34-
};
35-
3629
/**
3730
* struct nvmem_config - NVMEM device configuration
3831
*

0 commit comments

Comments
 (0)