From 68852c550950bd0e128d931d0bbb8519f490d24f Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 17 Jul 2020 15:59:10 -0400 Subject: [PATCH] cleanup mast_new_root Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fe22391fb1b8..d629ef533728 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2004,17 +2004,14 @@ static inline bool mast_new_root(struct maple_subtree_state *mast, mas_mn(mast->l)->parent = ma_parent_ptr(((unsigned long)mas->tree | MA_ROOT_PARENT)); mas->depth = mast->orig_l->depth; - mast->bn->b_end = 0; - if (mte_is_root(mast->orig_l->node)) { - if ((mast->orig_l->node != mas->node) && - (mast->l->depth > mas->tree->ma_height)) { - mat_add(mast->free, mas->node); - } - } else { + if (!mte_is_root(mast->orig_l->node)) { do { mast_ascend_free(mast); mast_topiary(mast); } while (!mte_is_root(mast->orig_l->node)); + } else if ((mast->orig_l->node != mas->node) && + (mast->l->depth > mas->tree->ma_height)) { + mat_add(mast->free, mas->node); } mat_add(mast->free, mast->orig_l->node); -- 2.50.1