Skip to contentSkip to conversation

nvdimm: make nd_class variable static

PATCH In review Ben Dooks 2 participants 2 messages Jun 16, 2023 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 nvdimm: make nd_class variable static

The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse is generating the following warning. Remove this by making it static:

drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. Should it be static?

---
 drivers/nvdimm/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvdimm/bus.c +1 -1
index 954dbc105fc8..5852fe290523 100644
@@ -25,7 +25,7 @@
 
 int nvdimm_major;
 static int nvdimm_bus_major;
-struct class *nd_class;
+static struct class *nd_class;
 static DEFINE_IDA(nd_ida);
 
 static int to_nd_device_type(const struct device *dev)
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ben Dooks

The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse is generating the following warning. Remove this by making it static:

drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. Should it be static?

Quoted 21 lines
---
 drivers/nvdimm/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvdimm/bus.c +1 -1
index 954dbc105fc8..5852fe290523 100644
@@ -25,7 +25,7 @@
 
 int nvdimm_major;
 static int nvdimm_bus_major;
-struct class *nd_class;
+static struct class *nd_class;
 static DEFINE_IDA(nd_ida);
 
 static int to_nd_device_type(const struct device *dev)
Signature · 1 line
2.39.2