summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-02-08 03:54:51 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-08 13:34:41 +0100
commit862f6a84d1bf01435fdd6aa8b2811c88ab1f06f4 (patch)
tree9cca76f3b0d328c0d4c636b3320e4b0df0260994 /samples
parentc83d9ab42f1ef70d81bb3c637a12c098a9a05057 (diff)
downloadlwn-862f6a84d1bf01435fdd6aa8b2811c88ab1f06f4.tar.gz
lwn-862f6a84d1bf01435fdd6aa8b2811c88ab1f06f4.zip
samples/kobject: 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 <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230208-kobj_type-samples-v1-1-fca804a8e9f3@weissschuh.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/kobject/kset-example.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 52f1acabd479..342452282719 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -185,7 +185,7 @@ ATTRIBUTE_GROUPS(foo_default);
* release function, and the set of default attributes we want created
* whenever a kobject of this type is registered with the kernel.
*/
-static struct kobj_type foo_ktype = {
+static const struct kobj_type foo_ktype = {
.sysfs_ops = &foo_sysfs_ops,
.release = foo_release,
.default_groups = foo_default_groups,