summaryrefslogtreecommitdiffstats
path: root/include/linux/kobject.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-21 10:46:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-22 17:34:52 +0100
commita53d1acc978321734a8fd7388f2c050a7219ab69 (patch)
tree43e078bf4a8003808966ee194fe097485c2c58aa /include/linux/kobject.h
parentc45a88bb3f6cdaeb29d8ee98463610ad815721ab (diff)
downloadlinux-a53d1acc978321734a8fd7388f2c050a7219ab69.tar.bz2
kobject: kset_uevent_ops: make name() callback take a const *
The name() callback in struct kset_uevent_ops does not modify the kobject passed into it, so make the pointer const to enforce this restriction. When doing so, fix up the single existing name() callback to have the correct signature to preserve the build. Acked-by: Rafael J. Wysocki <rafael@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20221121094649.1556002-4-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/kobject.h')
-rw-r--r--include/linux/kobject.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 640f59d4b3de..58a5b75612e3 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -136,7 +136,7 @@ struct kobj_uevent_env {
struct kset_uevent_ops {
int (* const filter)(const struct kobject *kobj);
- const char *(* const name)(struct kobject *kobj);
+ const char *(* const name)(const struct kobject *kobj);
int (* const uevent)(struct kobject *kobj, struct kobj_uevent_env *env);
};