scsi: make device_type const
authorBhumika Goyal <bhumirks@gmail.com>
Sat, 19 Aug 2017 08:22:24 +0000 (13:52 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 21:29:29 +0000 (17:29 -0400)
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fcoe/fcoe_sysfs.c
drivers/scsi/scsi_transport_iscsi.c

index 9cf3d56296ab87fca59da317412199afc354e5ba..5c8310bade619d63b1d239dc1878da7bf606f3fa 100644 (file)
@@ -659,13 +659,13 @@ static void fcoe_fcf_device_release(struct device *dev)
        kfree(fcf);
 }
 
-static struct device_type fcoe_ctlr_device_type = {
+static const struct device_type fcoe_ctlr_device_type = {
        .name = "fcoe_ctlr",
        .groups = fcoe_ctlr_attr_groups,
        .release = fcoe_ctlr_device_release,
 };
 
-static struct device_type fcoe_fcf_device_type = {
+static const struct device_type fcoe_fcf_device_type = {
        .name = "fcoe_fcf",
        .groups = fcoe_fcf_attr_groups,
        .release = fcoe_fcf_device_release,
index a424eaeafeb09852c898dc1e8a2326bce7109f29..b9513f82ec53e28bb4db7c5782bb94dbe9091fe4 100644 (file)
@@ -1009,7 +1009,7 @@ static void iscsi_flashnode_sess_release(struct device *dev)
        kfree(fnode_sess);
 }
 
-static struct device_type iscsi_flashnode_sess_dev_type = {
+static const struct device_type iscsi_flashnode_sess_dev_type = {
        .name = "iscsi_flashnode_sess_dev_type",
        .groups = iscsi_flashnode_sess_attr_groups,
        .release = iscsi_flashnode_sess_release,
@@ -1195,7 +1195,7 @@ static void iscsi_flashnode_conn_release(struct device *dev)
        kfree(fnode_conn);
 }
 
-static struct device_type iscsi_flashnode_conn_dev_type = {
+static const struct device_type iscsi_flashnode_conn_dev_type = {
        .name = "iscsi_flashnode_conn_dev_type",
        .groups = iscsi_flashnode_conn_attr_groups,
        .release = iscsi_flashnode_conn_release,