diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2021-05-29 12:30:49 +0200 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2021-06-14 22:32:07 -0700 |
commit | c32dc04059c79ddb4f7cff94ad5de6e92ea2218d (patch) | |
tree | 11ab78907c0326978858971cc6754b43ea949783 /drivers/md/md.c | |
parent | 608f52e30aae7dc8da836e5b7b112d50a2d00e43 (diff) |
md: Constify attribute_group structs
The attribute_group structs are never modified, they're only passed to
sysfs_create_group() and sysfs_remove_group(). Make them const to allow
the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 843e13666e3f..32abcfb8bcad 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -785,7 +785,7 @@ out_free_new: return ERR_PTR(error); } -static struct attribute_group md_redundancy_group; +static const struct attribute_group md_redundancy_group; void mddev_unlock(struct mddev *mddev) { @@ -802,7 +802,7 @@ void mddev_unlock(struct mddev *mddev) * test it under the same mutex to ensure its correct value * is seen. */ - struct attribute_group *to_remove = mddev->to_remove; + const struct attribute_group *to_remove = mddev->to_remove; mddev->to_remove = NULL; mddev->sysfs_active = 1; mutex_unlock(&mddev->reconfig_mutex); @@ -5500,7 +5500,7 @@ static struct attribute *md_redundancy_attrs[] = { &md_degraded.attr, NULL, }; -static struct attribute_group md_redundancy_group = { +static const struct attribute_group md_redundancy_group = { .name = NULL, .attrs = md_redundancy_attrs, }; |