提交 14193fb9 编写于 作者: J John Anthony Kazos Jr 提交者: 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: NJohn Anthony Kazos Jr. <jakj@j-a-k-j.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f89cbc39
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册