Skip to content

Commit

Permalink
most: core: Constify static attribute_group structs
Browse files Browse the repository at this point in the history
The only usage of these is to put their addresses in arrays of pointers
to const attribute_groups. Make them const to allow the compiler to put
them in read-only memory.

Signed-off-by: Rikard Falkeborn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
rikardfalkeborn authored and gregkh committed Jan 26, 2021
1 parent e424025 commit 26c2e92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/most/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static struct attribute *channel_attrs[] = {
NULL,
};

static struct attribute_group channel_attr_group = {
static const struct attribute_group channel_attr_group = {
.attrs = channel_attrs,
.is_visible = channel_attr_is_visible,
};
Expand Down Expand Up @@ -436,7 +436,7 @@ static struct attribute *interface_attrs[] = {
NULL,
};

static struct attribute_group interface_attr_group = {
static const struct attribute_group interface_attr_group = {
.attrs = interface_attrs,
};

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

static struct attribute_group mc_attr_group = {
static const struct attribute_group mc_attr_group = {
.attrs = mc_attrs,
};

Expand Down

0 comments on commit 26c2e92

Please sign in to comment.