Skip to contentSkip to conversation

x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst

PATCH Applied Bhumika Goyal 2 participants 2 messages Sep 18, 2017 – Sep 19, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst

Make this const as it is only used during a copy operation. This usage is inside init function and the structure is not referenced after initialisation, so make it __initconst too.

---
 arch/x86/pci/intel_mid_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/intel_mid_pci.c +1 -1
index b901ece..63fbe8f 100644
@@ -279,7 +279,7 @@ static void intel_mid_pci_irq_disable(struct pci_dev *dev)
 	}
 }
 
-static struct pci_ops intel_mid_pci_ops = {
+static const struct pci_ops intel_mid_pci_ops __initconst = {
 	.read = pci_read,
 	.write = pci_write,
 };
Signature · 1 line
1.9.1
#1 lore raw
Quoted 5 lines · Bhumika Goyal

Make this const as it is only used during a copy operation. This usage is inside init function and the structure is not referenced after initialisation, so make it __initconst too.

I applied this to pci/misc for v4.15, thanks!

If this conflicts with patches going via x86, I'll gladly drop it from my tree; just let me know.

Quoted 20 lines
---
 arch/x86/pci/intel_mid_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/intel_mid_pci.c +1 -1
index b901ece..63fbe8f 100644
@@ -279,7 +279,7 @@ static void intel_mid_pci_irq_disable(struct pci_dev *dev)
 	}
 }
 
-static struct pci_ops intel_mid_pci_ops = {
+static const struct pci_ops intel_mid_pci_ops __initconst = {
 	.read = pci_read,
 	.write = pci_write,
 };
Signature · 1 line
1.9.1