Commit 419cab3fc69588ebe35b845cc3a584ae172463de

Authored by Dmitry Torokhov
Committed by Greg Kroah-Hartman
1 parent f3b4f3c6de

[PATCH] kset_hotplug_ops->name shoudl return const char *

kobject: change name() method in kset_hotplug_ops return const char *
	 since users shoudl not try to modify returned data.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 3 changed files with 3 additions and 3 deletions Side-by-side Diff

drivers/base/class.c
... ... @@ -262,7 +262,7 @@
262 262 return 0;
263 263 }
264 264  
265   -static char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
  265 +static const char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
266 266 {
267 267 struct class_device *class_dev = to_class_dev(kobj);
268 268  
... ... @@ -102,7 +102,7 @@
102 102 return 0;
103 103 }
104 104  
105   -static char *dev_hotplug_name(struct kset *kset, struct kobject *kobj)
  105 +static const char *dev_hotplug_name(struct kset *kset, struct kobject *kobj)
106 106 {
107 107 struct device *dev = to_dev(kobj);
108 108  
include/linux/kobject.h
... ... @@ -94,7 +94,7 @@
94 94 */
95 95 struct kset_hotplug_ops {
96 96 int (*filter)(struct kset *kset, struct kobject *kobj);
97   - char *(*name)(struct kset *kset, struct kobject *kobj);
  97 + const char *(*name)(struct kset *kset, struct kobject *kobj);
98 98 int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp,
99 99 int num_envp, char *buffer, int buffer_size);
100 100 };