Commit 14193fb9 authored by John Anthony Kazos Jr's avatar John Anthony Kazos Jr Committed by Greg Kroah-Hartman

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: default avatarJohn Anthony Kazos Jr. <jakj@j-a-k-j.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f89cbc39
...@@ -95,10 +95,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, ...@@ -95,10 +95,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
/* search the kset we belong to */ /* search the kset we belong to */
top_kobj = kobj; top_kobj = kobj;
if (!top_kobj->kset && top_kobj->parent) { while (!top_kobj->kset && top_kobj->parent) {
do {
top_kobj = top_kobj->parent; top_kobj = top_kobj->parent;
} while (!top_kobj->kset && top_kobj->parent);
} }
if (!top_kobj->kset) { if (!top_kobj->kset) {
pr_debug("kobject attempted to send uevent without kset!\n"); pr_debug("kobject attempted to send uevent without kset!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment