From: Liam R. Howlett Date: Fri, 4 Dec 2020 02:56:04 +0000 (-0500) Subject: maple_tree: Code cleanup. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=66223ab2ac614ee57cb7ead812c578210fb276f4;p=users%2Fjedix%2Flinux-maple.git maple_tree: Code cleanup. remove unnecessary braces, space, and add an unlikely to __mas_walk() Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bd16d398921c..6b893447e2a7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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;