nvmem: Move nvmem_type_str array to its only user
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 30 Nov 2018 11:53:24 +0000 (11:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2018 14:45:46 +0000 (15:45 +0100)
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>
drivers/nvmem/core.c
include/linux/nvmem-provider.h

index d9fd11033c1c45a7026171eb0e953ea5cce9b8a9..22345e65a3011cf4c56a56311d4dc3a853d9f393 100644 (file)
@@ -61,6 +61,13 @@ static LIST_HEAD(nvmem_lookup_list);
 
 static BLOCKING_NOTIFIER_HEAD(nvmem_notifier);
 
+static const char * const nvmem_type_str[] = {
+       [NVMEM_TYPE_UNKNOWN] = "Unknown",
+       [NVMEM_TYPE_EEPROM] = "EEPROM",
+       [NVMEM_TYPE_OTP] = "OTP",
+       [NVMEM_TYPE_BATTERY_BACKED] = "Battery backed",
+};
+
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 static struct lock_class_key eeprom_lock_key;
 #endif
index 00ff92571683c847850d2eb8c9093c9dd7a66159..5b2dd0a987d2355477bfbe4d36855761e19a67a6 100644 (file)
@@ -26,13 +26,6 @@ enum nvmem_type {
        NVMEM_TYPE_BATTERY_BACKED,
 };
 
-static const char * const nvmem_type_str[] = {
-       [NVMEM_TYPE_UNKNOWN] = "Unknown",
-       [NVMEM_TYPE_EEPROM] = "EEPROM",
-       [NVMEM_TYPE_OTP] = "OTP",
-       [NVMEM_TYPE_BATTERY_BACKED] = "Battery backed",
-};
-
 /**
  * struct nvmem_config - NVMEM device configuration
  *