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

scsi: message: fusion: Constify struct pci_device_id

'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
36999 2451 88 39538 9a72 drivers/message/fusion/mptfc.o

After:
=====
text data bss dec hex filename
37415 2043 88 39546 9a7a drivers/message/fusion/mptfc.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/fe8f17a999b6def2649b2ef52ea5c9ee61e28bd0.1731705152.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Christophe JAILLET and committed by
Martin K. Petersen
e953835c c064de86

+3 -3
+1 -1
drivers/message/fusion/mptfc.c
··· 137 137 * Supported hardware 138 138 */ 139 139 140 - static struct pci_device_id mptfc_pci_table[] = { 140 + static const struct pci_device_id mptfc_pci_table[] = { 141 141 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC909, 142 142 PCI_ANY_ID, PCI_ANY_ID }, 143 143 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919,
+1 -1
drivers/message/fusion/mptsas.c
··· 5377 5377 mptscsih_remove(pdev); 5378 5378 } 5379 5379 5380 - static struct pci_device_id mptsas_pci_table[] = { 5380 + static const struct pci_device_id mptsas_pci_table[] = { 5381 5381 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064, 5382 5382 PCI_ANY_ID, PCI_ANY_ID }, 5383 5383 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068,
+1 -1
drivers/message/fusion/mptspi.c
··· 1238 1238 * Supported hardware 1239 1239 */ 1240 1240 1241 - static struct pci_device_id mptspi_pci_table[] = { 1241 + static const struct pci_device_id mptspi_pci_table[] = { 1242 1242 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030, 1243 1243 PCI_ANY_ID, PCI_ANY_ID }, 1244 1244 { PCI_VENDOR_ID_ATTO, MPI_MANUFACTPAGE_DEVID_53C1030,