Skip to content

Commit

Permalink
zonefs: make kobj_type structure 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 definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Damien Le Moal <[email protected]>
  • Loading branch information
t-8ch authored and Damien Le Moal committed Feb 12, 2023
1 parent 43592c4 commit 2b188a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/zonefs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static const struct sysfs_ops zonefs_sysfs_attr_ops = {
.show = zonefs_sysfs_attr_show,
};

static struct kobj_type zonefs_sb_ktype = {
static const struct kobj_type zonefs_sb_ktype = {
.default_groups = zonefs_sysfs_groups,
.sysfs_ops = &zonefs_sysfs_attr_ops,
.release = zonefs_sysfs_sb_release,
Expand Down

0 comments on commit 2b188a2

Please sign in to comment.