Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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 {
	while (!top_kobj->kset && top_kobj->parent) {
		top_kobj = top_kobj->parent;
		} while (!top_kobj->kset && top_kobj->parent);
	}
	if (!top_kobj->kset) {
		pr_debug("kobject attempted to send uevent without kset!\n");