[PATCH] chardev: make kobj_type structures constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 definitions to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
 fs/char_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/char_dev.c b/fs/char_dev.c
index 13deb45f1ec6..b33331cb97cd 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -624,11 +624,11 @@ static void cdev_dynamic_release(struct kobject *kobj)
 	kobject_put(parent);
 }
 
-static struct kobj_type ktype_cdev_default = {
+static const struct kobj_type ktype_cdev_default = {
 	.release	= cdev_default_release,
 };
 
-static struct kobj_type ktype_cdev_dynamic = {
+static const struct kobj_type ktype_cdev_dynamic = {
 	.release	= cdev_dynamic_release,
 };
 

---
base-commit: 033c40a89f55525139fd5b6342281b09b97d05bf
change-id: 20230216-kobj_type-chardev-f0d84e96be2e

Best regards,
-- 
Thomas Weißschuh <linux@xxxxxxxxxxxxxx>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux