diff options
author | John Anthony Kazos Jr <jakj@j-a-k-j.com> | 2007-04-04 13:39:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 19:57:29 +0200 |
commit | 14193fb91a7d88d3fe55d3160892edeb2b02e0c2 (patch) | |
tree | ea296da787836ffd0ac5c93879a8cc804cdb4a32 /lib/kobject_uevent.c | |
parent | Driver core: add suspend() and resume() to struct device_type (diff) | |
download | linux-14193fb91a7d88d3fe55d3160892edeb2b02e0c2.tar.xz linux-14193fb91a7d88d3fe55d3160892edeb2b02e0c2.zip |
Kobject: kobject_uevent.c: Collapse unnecessary loop nesting (top_kobj)
Collapses a do..while() loop within an if() to a simple while() loop for
simplicity and readability.
Signed-off-by: John Anthony Kazos Jr. <jakj@j-a-k-j.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r-- | lib/kobject_uevent.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 4122f38330d4..d9a3510ed2e2 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -95,10 +95,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, /* search the kset we belong to */ top_kobj = kobj; - if (!top_kobj->kset && top_kobj->parent) { - do { - top_kobj = top_kobj->parent; - } while (!top_kobj->kset && top_kobj->parent); + while (!top_kobj->kset && top_kobj->parent) { + top_kobj = top_kobj->parent; } if (!top_kobj->kset) { pr_debug("kobject attempted to send uevent without kset!\n"); |