summaryrefslogtreecommitdiff
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-02-05 01:36:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-08 15:34:30 +0300
commitc83d9ab42f1ef70d81bb3c637a12c098a9a05057 (patch)
tree501a3f7ca5f3a66ac4c16a617035941e118d84af /drivers/base/class.c
parentdda6b81f17ad8e72f8bc151c876cd335a471e268 (diff)
downloadlinux-c83d9ab42f1ef70d81bb3c637a12c098a9a05057.tar.xz
driver core: make kobj_type structures 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 definitions to prevent modification at runtime. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230204-kobj_type-driver-core-v1-1-b9f809419f2c@weissschuh.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index a38b0d7d681d..89d4528fcc1a 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -77,7 +77,7 @@ static const struct sysfs_ops class_sysfs_ops = {
.store = class_attr_store,
};
-static struct kobj_type class_ktype = {
+static const struct kobj_type class_ktype = {
.sysfs_ops = &class_sysfs_ops,
.release = class_release,
.child_ns_type = class_child_ns_type,