dm sysfs: make kobj_type structure constant

Message ID 20230214-kobj_type-dm-v1-1-f1e0ffee5373@weissschuh.net
State New
Headers
Series dm sysfs: make kobj_type structure constant |

Commit Message

Thomas Weißschuh Feb. 14, 2023, 3:20 a.m. UTC
  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 <linux@weissschuh.net>
---
 drivers/md/dm-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: f6feea56f66d34259c4222fa02e8171c4f2673d1
change-id: 20230214-kobj_type-dm-66ebe1e40530

Best regards,
  

Patch

diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index e28c92478536..dc281162f1d4 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -119,7 +119,7 @@  static const struct sysfs_ops dm_sysfs_ops = {
 	.store	= dm_attr_store,
 };
 
-static struct kobj_type dm_ktype = {
+static const struct kobj_type dm_ktype = {
 	.sysfs_ops	= &dm_sysfs_ops,
 	.default_groups	= dm_groups,
 	.release	= dm_kobject_release,