Skip to contentSkip to conversation

make i2c_adapter_names static to avoid sparse warnings

DISCUSSION Benson Leung 1 participant 2 messages Jan 30, 2013 1 message not in the archive x86 platform drivers

lore
Share & tools
lore

Benson Leung

author Reviewed-by
#1 lore raw
In reply to a message not in the archive

Thanks,
Benson

Quoted 15 lines · Xiechanglong

---
Index: linux/drivers/platform/x86/chromeos_laptop.c
===================================================================

drivers/platform/x86/chromeos_laptop.c +1 -1
@@ -31,7 +31,7 @@
 static struct i2c_client *als;
 static struct i2c_client *tp;
 
-const char *i2c_adapter_names[] = {
+static const char *i2c_adapter_names[] = {
        "SMBus I801 adapter",
 };
 
Signature · 3 lines
Benson Leung
Software Engineer, Chrom* OS
[email protected]
#2 lore raw

Actually, it looks like there's a checkpatch warning :

WARNING: static const char * array should probably be static const char * const #20: FILE: drivers/platform/x86/chromeos_laptop.c:34:
+static const char *i2c_adapter_names[] = {

total: 0 errors, 1 warnings, 8 lines checked

Quoted 28 lines · Benson Leung

Thanks,
Benson

Quoted 7 lines · Xiechanglong

---
Index: linux/drivers/platform/x86/chromeos_laptop.c
===================================================================

drivers/platform/x86/chromeos_laptop.c line 37

Quoted 8 lines
drivers/platform/x86/chromeos_laptop.c +1 -1
@@ -31,7 +31,7 @@
 static struct i2c_client *als;
 static struct i2c_client *tp;
 
-const char *i2c_adapter_names[] = {
+static const char *i2c_adapter_names[] = {
        "SMBus I801 adapter",
 };
 

--
Benson Leung
Software Engineer, Chrom* OS
[email protected]

Signature · 3 lines
Benson Leung
Software Engineer, Chrom* OS
[email protected]