[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181130115325.16539-6-srinivas.kandagatla@linaro.org>
Date: Fri, 30 Nov 2018 11:53:24 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH 5/6] nvmem: Move nvmem_type_str array to its only user
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
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@...tlin.com>
Suggested-by: Joe Perches <joe@...ches.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
drivers/nvmem/core.c | 7 +++++++
include/linux/nvmem-provider.h | 7 -------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index d9fd11033c1c..22345e65a301 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -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
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 00ff92571683..5b2dd0a987d2 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -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
*
--
2.19.2
Powered by blists - more mailing lists