From aa8651165f4619e7246d11ac06f051da1792c6e3 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 4 Mar 2022 11:45:00 -0500 Subject: [PATCH] maple_tree: Reduce ma_gap() protection on type Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 44403e5559cc9..8449d21118bd6 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)); -- 2.50.1