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.h | |
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.h')
-rw-r--r-- | drivers/md/md.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 4191f22acce4..b9b7d2f992f3 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -481,7 +481,7 @@ struct mddev { atomic_t max_corr_read_errors; /* max read retries */ struct list_head all_mddevs; - struct attribute_group *to_remove; + const struct attribute_group *to_remove; struct bio_set bio_set; struct bio_set sync_set; /* for sync operations like @@ -613,7 +613,7 @@ struct md_sysfs_entry { ssize_t (*show)(struct mddev *, char *); ssize_t (*store)(struct mddev *, const char *, size_t); }; -extern struct attribute_group md_bitmap_group; +extern const struct attribute_group md_bitmap_group; static inline struct kernfs_node *sysfs_get_dirent_safe(struct kernfs_node *sd, char *name) { |