]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Code cleanup.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 4 Dec 2020 02:56:04 +0000 (21:56 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:33:32 +0000 (12:33 -0500)
remove unnecessary braces, space, and add an unlikely to __mas_walk()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index bd16d398921cceb4fe28e575017795f1da577538..6b893447e2a7ebf9fe5de54123779591649427b5 100644 (file)
@@ -2853,8 +2853,9 @@ static inline int mas_commit_b_node(struct ma_state *mas,
                return mas_rebalance(mas, b_node);
 
 
-       if (b_node->b_end >= mt_slots[b_node->type])
+       if (b_node->b_end >= mt_slots[b_node->type]) {
                return mas_split(mas, b_node);
+       }
 
        if (mas_reuse_node(mas, b_node, end))
                goto reused_node;
@@ -3126,7 +3127,7 @@ static inline bool __mas_walk(struct ma_state *mas, unsigned long *range_min,
                mas->depth++;
 
                mas_node_walk(mas, type, range_min, range_max);
-               if (ma_is_leaf(type))
+               if (unlikely(ma_is_leaf(type)))
                        return true;
 
                next = mas_get_slot(mas, mas->offset);
@@ -3473,7 +3474,6 @@ static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite
        b_node.b_end = mas_store_b_node(mas, &b_node, entry, end);
        b_node.min = mas->min;
 
-
        if (!mas_commit_b_node(mas, &b_node, end))
                return NULL;