]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: message: fusion: Constify struct pci_device_id
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 15 Nov 2024 21:12:42 +0000 (22:12 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 21 Nov 2024 02:38:24 +0000 (21:38 -0500)
'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>
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptspi.c

index 91242f26defb008e0451cbc07074fc386565dfab..ee61b70aa677e925aec1bf44f68541e85f4c71cc 100644 (file)
@@ -137,7 +137,7 @@ static const struct scsi_host_template mptfc_driver_template = {
  * Supported hardware
  */
 
-static struct pci_device_id mptfc_pci_table[] = {
+static const struct pci_device_id mptfc_pci_table[] = {
        { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC909,
                PCI_ANY_ID, PCI_ANY_ID },
        { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919,
index a798e26c6402d430934a6ef3d0543a40a5001974..d0549a4daf76a4d0f53fdd3568ae0bb684df71e3 100644 (file)
@@ -5377,7 +5377,7 @@ static void mptsas_remove(struct pci_dev *pdev)
        mptscsih_remove(pdev);
 }
 
-static struct pci_device_id mptsas_pci_table[] = {
+static const struct pci_device_id mptsas_pci_table[] = {
        { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064,
                PCI_ANY_ID, PCI_ANY_ID },
        { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068,
index 574b882c9a85404971f92f1554cdc35c6a6b6c5b..4184d0c70ac31dfe968316026e2e8ea959d2c14d 100644 (file)
@@ -1238,7 +1238,7 @@ static struct spi_function_template mptspi_transport_functions = {
  * Supported hardware
  */
 
-static struct pci_device_id mptspi_pci_table[] = {
+static const struct pci_device_id mptspi_pci_table[] = {
        { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030,
                PCI_ANY_ID, PCI_ANY_ID },
        { PCI_VENDOR_ID_ATTO, MPI_MANUFACTPAGE_DEVID_53C1030,