Skip to content

Commit

Permalink
EDAC: Constify attribute_group structures
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ArvindYadavCs authored and suryasaimadhu committed Jul 17, 2017
1 parent fbe63ac commit 1c18be5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static struct attribute *csrow_attrs[] = {
NULL,
};

static struct attribute_group csrow_attr_grp = {
static const struct attribute_group csrow_attr_grp = {
.attrs = csrow_attrs,
};

Expand Down Expand Up @@ -627,7 +627,7 @@ static struct attribute *dimm_attrs[] = {
NULL,
};

static struct attribute_group dimm_attr_grp = {
static const struct attribute_group dimm_attr_grp = {
.attrs = dimm_attrs,
};

Expand Down Expand Up @@ -902,7 +902,7 @@ static umode_t mci_attr_is_visible(struct kobject *kobj,
return mode;
}

static struct attribute_group mci_attr_grp = {
static const struct attribute_group mci_attr_grp = {
.attrs = mci_attrs,
.is_visible = mci_attr_is_visible,
};
Expand Down
4 changes: 2 additions & 2 deletions drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ static struct attribute *i7core_addrmatch_attrs[] = {
NULL
};

static struct attribute_group addrmatch_grp = {
static const struct attribute_group addrmatch_grp = {
.attrs = i7core_addrmatch_attrs,
};

Expand Down Expand Up @@ -1110,7 +1110,7 @@ static struct attribute *i7core_udimm_counters_attrs[] = {
NULL
};

static struct attribute_group all_channel_counts_grp = {
static const struct attribute_group all_channel_counts_grp = {
.attrs = i7core_udimm_counters_attrs,
};

Expand Down

0 comments on commit 1c18be5

Please sign in to comment.