Skip to content

Commit 60db00e

Browse files
t-8chtytso
authored andcommitted
ext4: make kobj_type structures constant
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]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent ffec85d commit 60db00e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ext4/sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,13 @@ static const struct sysfs_ops ext4_attr_ops = {
501501
.store = ext4_attr_store,
502502
};
503503

504-
static struct kobj_type ext4_sb_ktype = {
504+
static const struct kobj_type ext4_sb_ktype = {
505505
.default_groups = ext4_groups,
506506
.sysfs_ops = &ext4_attr_ops,
507507
.release = ext4_sb_release,
508508
};
509509

510-
static struct kobj_type ext4_feat_ktype = {
510+
static const struct kobj_type ext4_feat_ktype = {
511511
.default_groups = ext4_feat_groups,
512512
.sysfs_ops = &ext4_attr_ops,
513513
.release = ext4_feat_release,

0 commit comments

Comments
 (0)