Skip to content

Commit 8394264

Browse files
ArvindYadavCsbjorn-helgaas
authored andcommitted
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>
1 parent 4bd3256 commit 8394264

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎drivers/pci/hotplug/cpcihp_zt5550.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static void zt5550_hc_remove_one(struct pci_dev *pdev)
280280
}
281281

282282

283-
static struct pci_device_id zt5550_hc_pci_tbl[] = {
283+
static const struct pci_device_id zt5550_hc_pci_tbl[] = {
284284
{ PCI_VENDOR_ID_ZIATECH, PCI_DEVICE_ID_ZIATECH_5550_HC, PCI_ANY_ID, PCI_ANY_ID, },
285285
{ 0, }
286286
};

‎drivers/pci/hotplug/cpqphp_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ static void __exit unload_cpqphpd(void)
14171417
iounmap(smbios_start);
14181418
}
14191419

1420-
static struct pci_device_id hpcd_pci_tbl[] = {
1420+
static const struct pci_device_id hpcd_pci_tbl[] = {
14211421
{
14221422
/* handle any PCI Hotplug controller */
14231423
.class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG << 8) | 0x00),

‎drivers/pci/hotplug/ibmphp_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ static int set_bus(struct slot *slot_cur)
852852
u8 speed;
853853
u8 cmd = 0x0;
854854
int retval;
855-
static struct pci_device_id ciobx[] = {
855+
static const struct pci_device_id ciobx[] = {
856856
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 0x0101) },
857857
{ },
858858
};

‎drivers/pci/hotplug/ibmphp_ebda.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ void ibmphp_free_ebda_pci_rsrc_queue(void)
11531153
}
11541154
}
11551155

1156-
static struct pci_device_id id_table[] = {
1156+
static const struct pci_device_id id_table[] = {
11571157
{
11581158
.vendor = PCI_VENDOR_ID_IBM,
11591159
.device = HPC_DEVICE_ID,

‎drivers/pci/hotplug/shpchp_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static void shpc_remove(struct pci_dev *dev)
351351
kfree(ctrl);
352352
}
353353

354-
static struct pci_device_id shpcd_pci_tbl[] = {
354+
static const struct pci_device_id shpcd_pci_tbl[] = {
355355
{PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0)},
356356
{ /* end: all zeroes */ }
357357
};

0 commit comments

Comments
 (0)