From: Liam R. Howlett Date: Tue, 12 Oct 2021 13:31:27 +0000 (-0400) Subject: maple_tree: Reduce mas_ascend() call to dead_node X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1ac2d7c17e8ff714ecfafea4f82579e4970db689;p=users%2Fjedix%2Flinux-maple.git maple_tree: Reduce mas_ascend() call to dead_node Since the node is known and the parent is known, use them directly. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1592bb2212ab..9275c26c3490 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1018,23 +1018,24 @@ static int mas_ascend(struct ma_state *mas) unsigned char offset; bool set_max = false, set_min = false; + a_node = mas_mn(mas); if (ma_is_root(a_node)) { mas->offset = 0; return 0; } - p_node = mte_parent(mas->node); a_type = mas_parent_enum(mas, mas->node); offset = mte_parent_slot(mas->node); - a_enode = mt_mk_node(p_node, a_type); - if (unlikely(mas_mn(mas) == p_node)) + p_node = mte_parent(mas->node); + if (unlikely(a_node == p_node)) return 1; /* Check to make sure all parent information is still accurate */ if (p_node != mte_parent(mas->node)) return 1; + a_enode = mt_mk_node(p_node, a_type); mas->node = a_enode; mas->offset = offset;