zonefs: make kobj_type structure constant
Subsystems (2)
PATCH 1/1 zonefs: make kobj_type structure constant
Since commit ee6d3dd4ed48 ("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]>
--- fs/zonefs/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/zonefs/sysfs.c +1 -1
@@ -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,
---
base-commit: e544a07438522ab3688416e6e2e34bf0ee6d8755
change-id: 20230210-kobj_type-zonefs-a124912033b3
Best regards,
Signature · 1 line
Thomas Weißschuh <[email protected]>
Looks good,
Reviewed-by Johannes Thumshirn <[email protected]>
Damien Le Moal
AppliedQuoted 7 lines · Thomas Weißschuh
Since commit
ee6d3dd4ed48("driver core: makekobj_typeconstant.") the driver core allows the usage of const structkobj_type.Take advantage of this to constify the structure definition to prevent modification at runtime.
Signed-off-by Thomas Weißschuh <[email protected]>
Applied to for-6.3. Thanks !
Signature · 2 lines
Damien Le Moal Western Digital Research