From 66223ab2ac614ee57cb7ead812c578210fb276f4 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Thu, 3 Dec 2020 21:56:04 -0500 Subject: [PATCH] maple_tree: Code cleanup. remove unnecessary braces, space, and add an unlikely to __mas_walk() Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.50.1