Signed-off-by: Michal Suchanek <[email protected]>
---
 hw/xfree86/loader/loadmod.c |   20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 65bf055..a6adae9 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1129,27 +1129,11 @@ UnloadSubModule(pointer _mod)
 static void
 RemoveChild(ModuleDescPtr child)
 {
-    ModuleDescPtr mdp;
-    ModuleDescPtr prevsib;
-    ModuleDescPtr parent;
-
     if (!child->parent)
         return;
 
-    parent = child->parent;
-    if (parent->child == child) {
-        parent->child = child->sib;
-        return;
-    }
-
-    prevsib = parent->child;
-    mdp = prevsib->sib;
-    while (mdp && mdp != child) {
-        prevsib = mdp;
-        mdp = mdp->sib;
-    }
-    if (mdp == child)
-        prevsib->sib = child->sib;
+    nt_list_del(child, child->parent->child, ModuleDesc, sib);
+    child->parent = NULL;
     child->sib = NULL;
     return;
 }
-- 
1.7.10.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to