2017-08-02 17:29:19

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/3] constify scsi pci_device_id.

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.

Arvind Yadav (3):
[PATCH 1/3] scsi: mptfusion: constify pci_device_id.
[PATCH 2/3] scsi: mptfc: constify pci_device_id.
[PATCH 3/3] scsi: mptsas: constify pci_device_id.

drivers/message/fusion/mptfc.c | 2 +-
drivers/message/fusion/mptsas.c | 2 +-
drivers/message/fusion/mptspi.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

--
2.7.4


2017-08-02 17:29:24

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/3] scsi: mptfusion: constify pci_device_id.

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 <[email protected]>
---
drivers/message/fusion/mptspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 9a336a1..f9823bb 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1243,7 +1243,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,
--
2.7.4

2017-08-02 17:29:30

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/3] scsi: mptfc: constify pci_device_id.

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 <[email protected]>
---
drivers/message/fusion/mptfc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index d065062..82cb864 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -138,7 +138,7 @@ static 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,
--
2.7.4

2017-08-02 17:29:46

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/3] scsi: mptsas: constify pci_device_id.

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 <[email protected]>
---
drivers/message/fusion/mptsas.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index f6308ad..8604573 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -5358,7 +5358,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,
--
2.7.4