Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Constify hotplug pci_device_id structures

pci_device_id are not supposed to change at runtime. All functions working
with pci_device_id provided by <linux/pci.h> work with const pci_device_id.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
[bhelgaas: squash shpchp, ibmphp, bmphp_ebda, cpcihp_zt5550, cpqphp]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

Arvind Yadav and committed by
Bjorn Helgaas
8394264d 4bd3256c

+5 -5
+1 -1
drivers/pci/hotplug/cpcihp_zt5550.c
··· 280 280 } 281 281 282 282 283 - static struct pci_device_id zt5550_hc_pci_tbl[] = { 283 + static const struct pci_device_id zt5550_hc_pci_tbl[] = { 284 284 { PCI_VENDOR_ID_ZIATECH, PCI_DEVICE_ID_ZIATECH_5550_HC, PCI_ANY_ID, PCI_ANY_ID, }, 285 285 { 0, } 286 286 };
+1 -1
drivers/pci/hotplug/cpqphp_core.c
··· 1417 1417 iounmap(smbios_start); 1418 1418 } 1419 1419 1420 - static struct pci_device_id hpcd_pci_tbl[] = { 1420 + static const struct pci_device_id hpcd_pci_tbl[] = { 1421 1421 { 1422 1422 /* handle any PCI Hotplug controller */ 1423 1423 .class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG << 8) | 0x00),
+1 -1
drivers/pci/hotplug/ibmphp_core.c
··· 852 852 u8 speed; 853 853 u8 cmd = 0x0; 854 854 int retval; 855 - static struct pci_device_id ciobx[] = { 855 + static const struct pci_device_id ciobx[] = { 856 856 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 0x0101) }, 857 857 { }, 858 858 };
+1 -1
drivers/pci/hotplug/ibmphp_ebda.c
··· 1153 1153 } 1154 1154 } 1155 1155 1156 - static struct pci_device_id id_table[] = { 1156 + static const struct pci_device_id id_table[] = { 1157 1157 { 1158 1158 .vendor = PCI_VENDOR_ID_IBM, 1159 1159 .device = HPC_DEVICE_ID,
+1 -1
drivers/pci/hotplug/shpchp_core.c
··· 351 351 kfree(ctrl); 352 352 } 353 353 354 - static struct pci_device_id shpcd_pci_tbl[] = { 354 + static const struct pci_device_id shpcd_pci_tbl[] = { 355 355 {PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0)}, 356 356 { /* end: all zeroes */ } 357 357 };