From: Liam R. Howlett Date: Fri, 4 Mar 2022 16:45:00 +0000 (-0500) Subject: maple_tree: Reduce ma_gap() protection on type X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aa8651165f4619e7246d11ac06f051da1792c6e3;p=users%2Fjedix%2Flinux-maple.git maple_tree: Reduce ma_gap() protection on type Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 44403e5559cc..8449d21118bd 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4749,11 +4749,7 @@ static bool mas_rev_awalk(struct ma_state *mas, unsigned long size) pivots = ma_pivots(node, type); slots = ma_slots(node, type); - if (ma_is_leaf(type)) - gaps = NULL; - else - gaps = ma_gaps(node, type); - + gaps = ma_gaps(node, type); offset = mas->offset; min = mas_safe_min(mas, pivots, offset); /* Skip out of bounds. */ @@ -4833,9 +4829,7 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) return true; } - if (!ma_is_leaf(type)) - gaps = ma_gaps(mte_to_node(mas->node), type); - + gaps = ma_gaps(mte_to_node(mas->node), type); offset = mas->offset; count = mt_slots[type]; min = mas_safe_min(mas, pivots, offset); @@ -6704,9 +6698,7 @@ void mas_validate_gaps(struct ma_state *mas) goto counted; } - if (!mte_is_leaf(mte)) - gaps = ma_gaps(mte_to_node(mte), mte_node_type(mte)); - + gaps = ma_gaps(mte_to_node(mte), mte_node_type(mte)); for (i = 0; i < mt_slot_count(mte); i++) { p_end = mas_logical_pivot(mas, pivots, i, mte_node_type(mte));