Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14193fb91a7d88d3fe55d3160892edeb2b02e0c2
Commit:     14193fb91a7d88d3fe55d3160892edeb2b02e0c2
Parent:     f89cbc399ecd924c4bd879344e662aace2274b4f
Author:     John Anthony Kazos Jr <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 4 07:39:17 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 10:57:29 2007 -0700

    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. <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 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 4122f38..d9a3510 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");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to