Skip to contentSkip to conversation

extcon: make extcon_info static const, fixes warning

PATCH Applied Colin King 2 participants 2 messages Sep 9, 2017 – Sep 11, 2017

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 extcon: make extcon_info static const, fixes warning

From: Colin Ian King <[email protected]>

The array extcon_info is read only, local to the source and does not need to be in global scope, so make it static const.

Cleans up sparse warning:
symbol 'extcon_info' was not declared. Should it be static?

---
 drivers/extcon/extcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon.c +1 -1
index 35e9fb885486..cb38c2747684 100644
@@ -36,7 +36,7 @@
 
 #define SUPPORTED_CABLE_MAX	32
 
-struct __extcon_info {
+static const struct __extcon_info {
 	unsigned int type;
 	unsigned int id;
 	const char *name;
Signature · 1 line
2.14.1
maintainer Applied
#1 lore raw
Quoted 19 lines · Colin King

From: Colin Ian King <[email protected]>

The array extcon_info is read only, local to the source and does not need to be in global scope, so make it static const.

Cleans up sparse warning:
symbol 'extcon_info' was not declared. Should it be static?

---
 drivers/extcon/extcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon.c +0 -0
index 35e9fb885486..cb38c2747684 100644

drivers/extcon/extcon.c line 42

Quoted 8 lines
drivers/extcon/extcon.c +1 -1
@@ -36,7 +36,7 @@
 
 #define SUPPORTED_CABLE_MAX	32
 
-struct __extcon_info {
+static const struct __extcon_info {
 	unsigned int type;
 	unsigned int id;
 	const char *name;

Applied it for v4.15. Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics