* [PATCH] dm sysfs: make kobj_type structure constant
@ 2023-02-14 3:20 ` Thomas Weißschuh
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Weißschuh @ 2023-02-14 3:20 UTC (permalink / raw)
To: Alasdair Kergon, Mike Snitzer, dm-devel
Cc: linux-kernel, Thomas Weißschuh
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(-)
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,
---
base-commit: f6feea56f66d34259c4222fa02e8171c4f2673d1
change-id: 20230214-kobj_type-dm-66ebe1e40530
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [dm-devel] [PATCH] dm sysfs: make kobj_type structure constant
@ 2023-02-14 3:20 ` Thomas Weißschuh
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Weißschuh @ 2023-02-14 3:20 UTC (permalink / raw)
To: Alasdair Kergon, Mike Snitzer, dm-devel
Cc: linux-kernel, Thomas Weißschuh
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(-)
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,
---
base-commit: f6feea56f66d34259c4222fa02e8171c4f2673d1
change-id: 20230214-kobj_type-dm-66ebe1e40530
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-14 7:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 3:20 [PATCH] dm sysfs: make kobj_type structure constant Thomas Weißschuh
2023-02-14 3:20 ` [dm-devel] " Thomas Weißschuh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.