diff options
author | Robert P. J. Day <rpjday@crashcourse.ca> | 2008-03-27 01:13:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 22:10:27 -0400 |
commit | c6a2a3dc26da72e431c293d02549593f9c041f63 (patch) | |
tree | 45ea5dcf2c8ae52f99507e941df3aa685fa70356 /lib | |
parent | c6f87733823d69a8f12e391688ceeb1ff4922530 (diff) |
Kobject: Replace list_for_each() with list_for_each_entry().
Use the more concise list_for_each_entry(), which allows for the
deletion of the to_kobj() routine at the same time.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kobject.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 60ae9e817663..2c6490370922 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -58,11 +58,6 @@ static int create_dir(struct kobject *kobj) | |||
58 | return error; | 58 | return error; |
59 | } | 59 | } |
60 | 60 | ||
61 | static inline struct kobject *to_kobj(struct list_head *entry) | ||
62 | { | ||
63 | return container_of(entry, struct kobject, entry); | ||
64 | } | ||
65 | |||
66 | static int get_kobj_path_length(struct kobject *kobj) | 61 | static int get_kobj_path_length(struct kobject *kobj) |
67 | { | 62 | { |
68 | int length = 1; | 63 | int length = 1; |
@@ -752,12 +747,11 @@ void kset_unregister(struct kset *k) | |||
752 | */ | 747 | */ |
753 | struct kobject *kset_find_obj(struct kset *kset, const char *name) | 748 | struct kobject *kset_find_obj(struct kset *kset, const char *name) |
754 | { | 749 | { |
755 | struct list_head *entry; | 750 | struct kobject *k; |
756 | struct kobject *ret = NULL; | 751 | struct kobject *ret = NULL; |
757 | 752 | ||
758 | spin_lock(&kset->list_lock); | 753 | spin_lock(&kset->list_lock); |
759 | list_for_each(entry, &kset->list) { | 754 | list_for_each_entry(k, &kset->list, entry) { |
760 | struct kobject *k = to_kobj(entry); | ||
761 | if (kobject_name(k) && !strcmp(kobject_name(k), name)) { | 755 | if (kobject_name(k) && !strcmp(kobject_name(k), name)) { |
762 | ret = kobject_get(k); | 756 | ret = kobject_get(k); |
763 | break; | 757 | break; |