Skip to content

Commit

Permalink
erofs: make kobj_type structures constant
Browse files Browse the repository at this point in the history
Since commit ee6d3dd ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definitions to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Gao Xiang <[email protected]>
Reviewed-by: Jingbo Xu <[email protected]>
Reviewed-by: Yue Hu <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Gao Xiang <[email protected]>
  • Loading branch information
t-8ch authored and hsiangkao committed Feb 15, 2023
1 parent 3fffb58 commit 339bc4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/erofs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ static const struct sysfs_ops erofs_attr_ops = {
.store = erofs_attr_store,
};

static struct kobj_type erofs_sb_ktype = {
static const struct kobj_type erofs_sb_ktype = {
.default_groups = erofs_groups,
.sysfs_ops = &erofs_attr_ops,
.release = erofs_sb_release,
};

static struct kobj_type erofs_ktype = {
static const struct kobj_type erofs_ktype = {
.sysfs_ops = &erofs_attr_ops,
};

static struct kset erofs_root = {
.kobj = {.ktype = &erofs_ktype},
};

static struct kobj_type erofs_feat_ktype = {
static const struct kobj_type erofs_feat_ktype = {
.default_groups = erofs_feat_groups,
.sysfs_ops = &erofs_attr_ops,
};
Expand Down

0 comments on commit 339bc4d

Please sign in to comment.