[PATCH 2/7] xfree86/loader: Convert RemoveChild to nt_list macro.
Michal Suchanek
hramrach at gmail.com
Tue Jul 17 08:11:01 PDT 2012
Signed-off-by: Michal Suchanek <hramrach at gmail.com>
---
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
More information about the xorg-devel
mailing list