Skip to content

Commit e953835

Browse files
tititiou36martinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/fe8f17a999b6def2649b2ef52ea5c9ee61e28bd0.1731705152.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c064de8 commit e953835

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/message/fusion/mptfc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static const struct scsi_host_template mptfc_driver_template = {
137137
* Supported hardware
138138
*/
139139

140-
static struct pci_device_id mptfc_pci_table[] = {
140+
static const struct pci_device_id mptfc_pci_table[] = {
141141
{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC909,
142142
PCI_ANY_ID, PCI_ANY_ID },
143143
{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919,

drivers/message/fusion/mptsas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5377,7 +5377,7 @@ static void mptsas_remove(struct pci_dev *pdev)
53775377
mptscsih_remove(pdev);
53785378
}
53795379

5380-
static struct pci_device_id mptsas_pci_table[] = {
5380+
static const struct pci_device_id mptsas_pci_table[] = {
53815381
{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064,
53825382
PCI_ANY_ID, PCI_ANY_ID },
53835383
{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068,

drivers/message/fusion/mptspi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ static struct spi_function_template mptspi_transport_functions = {
12381238
* Supported hardware
12391239
*/
12401240

1241-
static struct pci_device_id mptspi_pci_table[] = {
1241+
static const struct pci_device_id mptspi_pci_table[] = {
12421242
{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030,
12431243
PCI_ANY_ID, PCI_ANY_ID },
12441244
{ PCI_VENDOR_ID_ATTO, MPI_MANUFACTPAGE_DEVID_53C1030,

0 commit comments

Comments
 (0)