diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-07-17 04:20:25 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2017-07-17 04:20:25 -0400 |
commit | 1c18be5a4e3ecbb40fbee015711aea6cc6467417 (patch) | |
tree | 4bd05deb05fa39201a63e29c4c8f3bdc925f94cd | |
parent | fbe63acf62f57f8e51adae602c5ce1025002d5ee (diff) |
EDAC: Constify attribute_group structures
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work with
const attribute_group. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
CC: linux-edac@vger.kernel.org
Link: http://lkml.kernel.org/r/776cb8265509054abd01b0b551624cc0da3b88e7.1499078335.git.arvind.yadav.cs@gmail.com
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 6 | ||||
-rw-r--r-- | drivers/edac/i7core_edac.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 445862dac273..dbc64469b7da 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -287,7 +287,7 @@ static struct attribute *csrow_attrs[] = { | |||
287 | NULL, | 287 | NULL, |
288 | }; | 288 | }; |
289 | 289 | ||
290 | static struct attribute_group csrow_attr_grp = { | 290 | static const struct attribute_group csrow_attr_grp = { |
291 | .attrs = csrow_attrs, | 291 | .attrs = csrow_attrs, |
292 | }; | 292 | }; |
293 | 293 | ||
@@ -627,7 +627,7 @@ static struct attribute *dimm_attrs[] = { | |||
627 | NULL, | 627 | NULL, |
628 | }; | 628 | }; |
629 | 629 | ||
630 | static struct attribute_group dimm_attr_grp = { | 630 | static const struct attribute_group dimm_attr_grp = { |
631 | .attrs = dimm_attrs, | 631 | .attrs = dimm_attrs, |
632 | }; | 632 | }; |
633 | 633 | ||
@@ -902,7 +902,7 @@ static umode_t mci_attr_is_visible(struct kobject *kobj, | |||
902 | return mode; | 902 | return mode; |
903 | } | 903 | } |
904 | 904 | ||
905 | static struct attribute_group mci_attr_grp = { | 905 | static const struct attribute_group mci_attr_grp = { |
906 | .attrs = mci_attrs, | 906 | .attrs = mci_attrs, |
907 | .is_visible = mci_attr_is_visible, | 907 | .is_visible = mci_attr_is_visible, |
908 | }; | 908 | }; |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 75ad847593b7..ba0fa112996f 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1079,7 +1079,7 @@ static struct attribute *i7core_addrmatch_attrs[] = { | |||
1079 | NULL | 1079 | NULL |
1080 | }; | 1080 | }; |
1081 | 1081 | ||
1082 | static struct attribute_group addrmatch_grp = { | 1082 | static const struct attribute_group addrmatch_grp = { |
1083 | .attrs = i7core_addrmatch_attrs, | 1083 | .attrs = i7core_addrmatch_attrs, |
1084 | }; | 1084 | }; |
1085 | 1085 | ||
@@ -1110,7 +1110,7 @@ static struct attribute *i7core_udimm_counters_attrs[] = { | |||
1110 | NULL | 1110 | NULL |
1111 | }; | 1111 | }; |
1112 | 1112 | ||
1113 | static struct attribute_group all_channel_counts_grp = { | 1113 | static const struct attribute_group all_channel_counts_grp = { |
1114 | .attrs = i7core_udimm_counters_attrs, | 1114 | .attrs = i7core_udimm_counters_attrs, |
1115 | }; | 1115 | }; |
1116 | 1116 | ||