]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Reduce ma_gap() protection on type
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 4 Mar 2022 16:45:00 +0000 (11:45 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Mar 2022 18:19:16 +0000 (13:19 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 44403e5559cc9061896df813405eaed6204c403f..8449d21118bd6836936ab0b7151b0172c4cba986 100644 (file)
@@ -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));