diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-10-16 11:18:47 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-10-19 10:15:28 -0400 |
commit | 66603a31f8969353654e092f6b286a653ac71e71 (patch) | |
tree | 96a16295b465f165dad528457e0de75549e197da | |
parent | 4ad0141226f00eee3cfe4392c27e14bf15520640 (diff) |
nvmet: make config_item_type const
Make config_item_type structures const as they are either passed to a
function having the argument as const or used inside an if statement or
stored in the const "ci_type" field of a config_item structure.
Done using Coccinelle
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/nvme/target/configfs.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index b6aeb1d70951..e6b2d2af81b6 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c | |||
@@ -20,8 +20,8 @@ | |||
20 | 20 | ||
21 | #include "nvmet.h" | 21 | #include "nvmet.h" |
22 | 22 | ||
23 | static struct config_item_type nvmet_host_type; | 23 | static const struct config_item_type nvmet_host_type; |
24 | static struct config_item_type nvmet_subsys_type; | 24 | static const struct config_item_type nvmet_subsys_type; |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * nvmet_port Generic ConfigFS definitions. | 27 | * nvmet_port Generic ConfigFS definitions. |
@@ -425,7 +425,7 @@ static struct configfs_item_operations nvmet_ns_item_ops = { | |||
425 | .release = nvmet_ns_release, | 425 | .release = nvmet_ns_release, |
426 | }; | 426 | }; |
427 | 427 | ||
428 | static struct config_item_type nvmet_ns_type = { | 428 | static const struct config_item_type nvmet_ns_type = { |
429 | .ct_item_ops = &nvmet_ns_item_ops, | 429 | .ct_item_ops = &nvmet_ns_item_ops, |
430 | .ct_attrs = nvmet_ns_attrs, | 430 | .ct_attrs = nvmet_ns_attrs, |
431 | .ct_owner = THIS_MODULE, | 431 | .ct_owner = THIS_MODULE, |
@@ -464,7 +464,7 @@ static struct configfs_group_operations nvmet_namespaces_group_ops = { | |||
464 | .make_group = nvmet_ns_make, | 464 | .make_group = nvmet_ns_make, |
465 | }; | 465 | }; |
466 | 466 | ||
467 | static struct config_item_type nvmet_namespaces_type = { | 467 | static const struct config_item_type nvmet_namespaces_type = { |
468 | .ct_group_ops = &nvmet_namespaces_group_ops, | 468 | .ct_group_ops = &nvmet_namespaces_group_ops, |
469 | .ct_owner = THIS_MODULE, | 469 | .ct_owner = THIS_MODULE, |
470 | }; | 470 | }; |
@@ -540,7 +540,7 @@ static struct configfs_item_operations nvmet_port_subsys_item_ops = { | |||
540 | .drop_link = nvmet_port_subsys_drop_link, | 540 | .drop_link = nvmet_port_subsys_drop_link, |
541 | }; | 541 | }; |
542 | 542 | ||
543 | static struct config_item_type nvmet_port_subsys_type = { | 543 | static const struct config_item_type nvmet_port_subsys_type = { |
544 | .ct_item_ops = &nvmet_port_subsys_item_ops, | 544 | .ct_item_ops = &nvmet_port_subsys_item_ops, |
545 | .ct_owner = THIS_MODULE, | 545 | .ct_owner = THIS_MODULE, |
546 | }; | 546 | }; |
@@ -613,7 +613,7 @@ static struct configfs_item_operations nvmet_allowed_hosts_item_ops = { | |||
613 | .drop_link = nvmet_allowed_hosts_drop_link, | 613 | .drop_link = nvmet_allowed_hosts_drop_link, |
614 | }; | 614 | }; |
615 | 615 | ||
616 | static struct config_item_type nvmet_allowed_hosts_type = { | 616 | static const struct config_item_type nvmet_allowed_hosts_type = { |
617 | .ct_item_ops = &nvmet_allowed_hosts_item_ops, | 617 | .ct_item_ops = &nvmet_allowed_hosts_item_ops, |
618 | .ct_owner = THIS_MODULE, | 618 | .ct_owner = THIS_MODULE, |
619 | }; | 619 | }; |
@@ -729,7 +729,7 @@ static struct configfs_item_operations nvmet_subsys_item_ops = { | |||
729 | .release = nvmet_subsys_release, | 729 | .release = nvmet_subsys_release, |
730 | }; | 730 | }; |
731 | 731 | ||
732 | static struct config_item_type nvmet_subsys_type = { | 732 | static const struct config_item_type nvmet_subsys_type = { |
733 | .ct_item_ops = &nvmet_subsys_item_ops, | 733 | .ct_item_ops = &nvmet_subsys_item_ops, |
734 | .ct_attrs = nvmet_subsys_attrs, | 734 | .ct_attrs = nvmet_subsys_attrs, |
735 | .ct_owner = THIS_MODULE, | 735 | .ct_owner = THIS_MODULE, |
@@ -767,7 +767,7 @@ static struct configfs_group_operations nvmet_subsystems_group_ops = { | |||
767 | .make_group = nvmet_subsys_make, | 767 | .make_group = nvmet_subsys_make, |
768 | }; | 768 | }; |
769 | 769 | ||
770 | static struct config_item_type nvmet_subsystems_type = { | 770 | static const struct config_item_type nvmet_subsystems_type = { |
771 | .ct_group_ops = &nvmet_subsystems_group_ops, | 771 | .ct_group_ops = &nvmet_subsystems_group_ops, |
772 | .ct_owner = THIS_MODULE, | 772 | .ct_owner = THIS_MODULE, |
773 | }; | 773 | }; |
@@ -827,7 +827,7 @@ static struct configfs_item_operations nvmet_referral_item_ops = { | |||
827 | .release = nvmet_referral_release, | 827 | .release = nvmet_referral_release, |
828 | }; | 828 | }; |
829 | 829 | ||
830 | static struct config_item_type nvmet_referral_type = { | 830 | static const struct config_item_type nvmet_referral_type = { |
831 | .ct_owner = THIS_MODULE, | 831 | .ct_owner = THIS_MODULE, |
832 | .ct_attrs = nvmet_referral_attrs, | 832 | .ct_attrs = nvmet_referral_attrs, |
833 | .ct_item_ops = &nvmet_referral_item_ops, | 833 | .ct_item_ops = &nvmet_referral_item_ops, |
@@ -852,7 +852,7 @@ static struct configfs_group_operations nvmet_referral_group_ops = { | |||
852 | .make_group = nvmet_referral_make, | 852 | .make_group = nvmet_referral_make, |
853 | }; | 853 | }; |
854 | 854 | ||
855 | static struct config_item_type nvmet_referrals_type = { | 855 | static const struct config_item_type nvmet_referrals_type = { |
856 | .ct_owner = THIS_MODULE, | 856 | .ct_owner = THIS_MODULE, |
857 | .ct_group_ops = &nvmet_referral_group_ops, | 857 | .ct_group_ops = &nvmet_referral_group_ops, |
858 | }; | 858 | }; |
@@ -880,7 +880,7 @@ static struct configfs_item_operations nvmet_port_item_ops = { | |||
880 | .release = nvmet_port_release, | 880 | .release = nvmet_port_release, |
881 | }; | 881 | }; |
882 | 882 | ||
883 | static struct config_item_type nvmet_port_type = { | 883 | static const struct config_item_type nvmet_port_type = { |
884 | .ct_attrs = nvmet_port_attrs, | 884 | .ct_attrs = nvmet_port_attrs, |
885 | .ct_item_ops = &nvmet_port_item_ops, | 885 | .ct_item_ops = &nvmet_port_item_ops, |
886 | .ct_owner = THIS_MODULE, | 886 | .ct_owner = THIS_MODULE, |
@@ -921,7 +921,7 @@ static struct configfs_group_operations nvmet_ports_group_ops = { | |||
921 | .make_group = nvmet_ports_make, | 921 | .make_group = nvmet_ports_make, |
922 | }; | 922 | }; |
923 | 923 | ||
924 | static struct config_item_type nvmet_ports_type = { | 924 | static const struct config_item_type nvmet_ports_type = { |
925 | .ct_group_ops = &nvmet_ports_group_ops, | 925 | .ct_group_ops = &nvmet_ports_group_ops, |
926 | .ct_owner = THIS_MODULE, | 926 | .ct_owner = THIS_MODULE, |
927 | }; | 927 | }; |
@@ -940,7 +940,7 @@ static struct configfs_item_operations nvmet_host_item_ops = { | |||
940 | .release = nvmet_host_release, | 940 | .release = nvmet_host_release, |
941 | }; | 941 | }; |
942 | 942 | ||
943 | static struct config_item_type nvmet_host_type = { | 943 | static const struct config_item_type nvmet_host_type = { |
944 | .ct_item_ops = &nvmet_host_item_ops, | 944 | .ct_item_ops = &nvmet_host_item_ops, |
945 | .ct_owner = THIS_MODULE, | 945 | .ct_owner = THIS_MODULE, |
946 | }; | 946 | }; |
@@ -963,14 +963,14 @@ static struct configfs_group_operations nvmet_hosts_group_ops = { | |||
963 | .make_group = nvmet_hosts_make_group, | 963 | .make_group = nvmet_hosts_make_group, |
964 | }; | 964 | }; |
965 | 965 | ||
966 | static struct config_item_type nvmet_hosts_type = { | 966 | static const struct config_item_type nvmet_hosts_type = { |
967 | .ct_group_ops = &nvmet_hosts_group_ops, | 967 | .ct_group_ops = &nvmet_hosts_group_ops, |
968 | .ct_owner = THIS_MODULE, | 968 | .ct_owner = THIS_MODULE, |
969 | }; | 969 | }; |
970 | 970 | ||
971 | static struct config_group nvmet_hosts_group; | 971 | static struct config_group nvmet_hosts_group; |
972 | 972 | ||
973 | static struct config_item_type nvmet_root_type = { | 973 | static const struct config_item_type nvmet_root_type = { |
974 | .ct_owner = THIS_MODULE, | 974 | .ct_owner = THIS_MODULE, |
975 | }; | 975 | }; |
976 | 976 | ||