Skip to contentSkip to conversation

switchtec: make struct event_regs static

PATCH In review Colin King 3 participants 3 messages Oct 5, 2017

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 switchtec: make struct event_regs static

From: Colin Ian King <[email protected]>

The structure event_regs is local to the source and does not need to be in global scope, so make it static.

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

---
 drivers/pci/switch/switchtec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/switch/switchtec.c +1 -1
index af81b2dec42e..da45dbea20ce 100644
@@ -943,7 +943,7 @@ static u32 __iomem *pff_ev_reg(struct switchtec_dev *stdev,
 #define EV_PAR(i, r)[i] = {offsetof(struct part_cfg_regs, r), part_ev_reg}
 #define EV_PFF(i, r)[i] = {offsetof(struct pff_csr_regs, r), pff_ev_reg}
 
-const struct event_reg {
+static const struct event_reg {
 	size_t offset;
 	u32 __iomem *(*map_reg)(struct switchtec_dev *stdev,
 				size_t offset, int index);
Signature · 1 line
2.14.1
maintainer Acked-by on v1 1/1
#1 lore raw

Thanks!

Quoted 27 lines · Colin King

From: Colin Ian King <[email protected]>

The structure event_regs is local to the source and does not need to be in global scope, so make it static.

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

---
  drivers/pci/switch/switchtec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/switch/switchtec.c +1 -1
index af81b2dec42e..da45dbea20ce 100644
@@ -943,7 +943,7 @@ static u32 __iomem *pff_ev_reg(struct switchtec_dev *stdev,
  #define EV_PAR(i, r)[i] = {offsetof(struct part_cfg_regs, r), part_ev_reg}
  #define EV_PFF(i, r)[i] = {offsetof(struct pff_csr_regs, r), pff_ev_reg}
 
-const struct event_reg {
+static const struct event_reg {
  	size_t offset;
  	u32 __iomem *(*map_reg)(struct switchtec_dev *stdev,
  				size_t offset, int index);
#2 lore raw
In reply to Colin King
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The structure event_regs is local to the source and does not need to be in global scope, so make it static.

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

Applied with Logan's ack to pci/switchtec for v4.15, thanks!

Quoted 20 lines
---
 drivers/pci/switch/switchtec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/switch/switchtec.c +1 -1
index af81b2dec42e..da45dbea20ce 100644
@@ -943,7 +943,7 @@ static u32 __iomem *pff_ev_reg(struct switchtec_dev *stdev,
 #define EV_PAR(i, r)[i] = {offsetof(struct part_cfg_regs, r), part_ev_reg}
 #define EV_PFF(i, r)[i] = {offsetof(struct pff_csr_regs, r), pff_ev_reg}
 
-const struct event_reg {
+static const struct event_reg {
 	size_t offset;
 	u32 __iomem *(*map_reg)(struct switchtec_dev *stdev,
 				size_t offset, int index);
Signature · 1 line
2.14.1