Skip to content

Commit bc8305b

Browse files
committed
scsi: Constify struct pci_device_id
JIRA: https://issues.redhat.com/browse/RHEL-72637 Conflicts: resolved conflict in qla_os.c due to commit 344ae03 ("qla2xxx: Remove PCI IDs of deprecated adapter") 'struct pci_device_id' is not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 70237 9137 320 79694 1374e drivers/scsi/3w-9xxx.o After: ===== text data bss dec hex filename 70461 8913 320 79694 1374e drivers/scsi/3w-9xxx.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/fc61b1946488c1ea8f7a17a06cf40fbd05dcc6de.1733590049.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit c9a71ca) Signed-off-by: John Meneghini <jmeneghi@redhat.com>
1 parent a61b033 commit bc8305b

32 files changed

+32
-32
lines changed

drivers/scsi/3w-9xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2261,7 +2261,7 @@ static int __maybe_unused twa_resume(struct device *dev)
22612261
} /* End twa_resume() */
22622262

22632263
/* PCI Devices supported by this driver */
2264-
static struct pci_device_id twa_pci_tbl[] = {
2264+
static const struct pci_device_id twa_pci_tbl[] = {
22652265
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9000,
22662266
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
22672267
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX,

drivers/scsi/3w-sas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ static int __maybe_unused twl_resume(struct device *dev)
18251825
} /* End twl_resume() */
18261826

18271827
/* PCI Devices supported by this driver */
1828-
static struct pci_device_id twl_pci_tbl[] = {
1828+
static const struct pci_device_id twl_pci_tbl[] = {
18291829
{ PCI_VDEVICE(3WARE, PCI_DEVICE_ID_3WARE_9750) },
18301830
{ }
18311831
};

drivers/scsi/3w-xxxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ static void tw_remove(struct pci_dev *pdev)
23912391
} /* End tw_remove() */
23922392

23932393
/* PCI Devices supported by this driver */
2394-
static struct pci_device_id tw_pci_tbl[] = {
2394+
static const struct pci_device_id tw_pci_tbl[] = {
23952395
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_1000,
23962396
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
23972397
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_7000,

drivers/scsi/BusLogic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3706,7 +3706,7 @@ static void __exit blogic_exit(void)
37063706
__setup("BusLogic=", blogic_setup);
37073707

37083708
#ifdef MODULE
3709-
/*static struct pci_device_id blogic_pci_tbl[] = {
3709+
/*static const struct pci_device_id blogic_pci_tbl[] = {
37103710
{ PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER,
37113711
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
37123712
{ PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC,

drivers/scsi/a100u2w.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ static void inia100_remove_one(struct pci_dev *pdev)
12091209
scsi_host_put(shost);
12101210
}
12111211

1212-
static struct pci_device_id inia100_pci_tbl[] = {
1212+
static const struct pci_device_id inia100_pci_tbl[] = {
12131213
{PCI_VENDOR_ID_INIT, 0x1060, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
12141214
{0,}
12151215
};

drivers/scsi/advansys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11400,7 +11400,7 @@ static struct eisa_driver advansys_eisa_driver = {
1140011400
};
1140111401

1140211402
/* PCI Devices supported by this driver */
11403-
static struct pci_device_id advansys_pci_tbl[] = {
11403+
static const struct pci_device_id advansys_pci_tbl[] = {
1140411404
{PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A,
1140511405
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
1140611406
{PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940,

drivers/scsi/am53c974.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static void pci_esp_remove_one(struct pci_dev *pdev)
513513
scsi_host_put(esp->host);
514514
}
515515

516-
static struct pci_device_id am53c974_pci_tbl[] = {
516+
static const struct pci_device_id am53c974_pci_tbl[] = {
517517
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SCSI,
518518
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
519519
{ }

drivers/scsi/arcmsr/arcmsr_hba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static struct scsi_host_template arcmsr_scsi_host_template = {
170170
.no_write_same = 1,
171171
};
172172

173-
static struct pci_device_id arcmsr_device_id_table[] = {
173+
static const struct pci_device_id arcmsr_device_id_table[] = {
174174
{PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1110),
175175
.driver_data = ACB_ADAPTER_TYPE_A},
176176
{PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1120),

drivers/scsi/atp870u.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ static struct scsi_host_template atp870u_template = {
17531753
.max_sectors = ATP870U_MAX_SECTORS,
17541754
};
17551755

1756-
static struct pci_device_id atp870u_id_table[] = {
1756+
static const struct pci_device_id atp870u_id_table[] = {
17571757
{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP885_DEVID) },
17581758
{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP880_DEVID1) },
17591759
{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP880_DEVID2) },

drivers/scsi/cxlflash/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3168,7 +3168,7 @@ static struct dev_dependent_vals dev_briard_vals = { CXLFLASH_MAX_SECTORS,
31683168
/*
31693169
* PCI device binding table
31703170
*/
3171-
static struct pci_device_id cxlflash_pci_table[] = {
3171+
static const struct pci_device_id cxlflash_pci_table[] = {
31723172
{PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CORSA,
31733173
PCI_ANY_ID, PCI_ANY_ID, 0, 0, (kernel_ulong_t)&dev_corsa_vals},
31743174
{PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_FLASH_GT,

0 commit comments

Comments
 (0)