Skip to content

Commit

Permalink
[PATCH] kset_hotplug_ops->name shoudl return const char *
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Greg Kroah-Hartman committed Jun 20, 2005
1 parent f3b4f3c commit 419cab3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static int class_hotplug_filter(struct kset *kset, struct kobject *kobj)
return 0;
}

static char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
static const char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
{
struct class_device *class_dev = to_class_dev(kobj);

Expand Down
2 changes: 1 addition & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int dev_hotplug_filter(struct kset *kset, struct kobject *kobj)
return 0;
}

static char *dev_hotplug_name(struct kset *kset, struct kobject *kobj)
static const char *dev_hotplug_name(struct kset *kset, struct kobject *kobj)
{
struct device *dev = to_dev(kobj);

Expand Down
2 changes: 1 addition & 1 deletion include/linux/kobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct kobj_type {
*/
struct kset_hotplug_ops {
int (*filter)(struct kset *kset, struct kobject *kobj);
char *(*name)(struct kset *kset, struct kobject *kobj);
const char *(*name)(struct kset *kset, struct kobject *kobj);
int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp,
int num_envp, char *buffer, int buffer_size);
};
Expand Down

0 comments on commit 419cab3

Please sign in to comment.