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>
This commit is contained in:
parent
f89cbc399e
commit
14193fb91a
|
@ -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");
|
||||||
|
|
Loading…
Reference in New Issue