Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Dmitry Torokhov and committed by
Greg Kroah-Hartman
419cab3f f3b4f3c6

+3 -3
+1 -1
drivers/base/class.c
··· 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
+1 -1
drivers/base/core.c
··· 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
+1 -1
include/linux/kobject.h
··· 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 };