From 0da5a0568cee5a7c3a1dc0ccff78bc3d94c6caf2 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 2 Mar 2020 14:54:06 -0500 Subject: [PATCH] maple_tree: Small code cleanup, white spaces etc. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 14 +++++--------- lib/test_maple_tree.c | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d6eaeac816b0..3a2ad10b4e5c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2032,7 +2032,7 @@ static inline enum maple_type mas_ptype_leaf(struct ma_state *mas) * */ static inline int mas_split(struct ma_state *mas, unsigned char slot, - bool active, unsigned entry_cnt, void *entry) + bool active, unsigned char entry_cnt, void *entry) { struct maple_enode *full = mas->node; unsigned char split, p_slot = 0, p_end = 0, link = 0; @@ -2042,7 +2042,7 @@ static inline int mas_split(struct ma_state *mas, unsigned char slot, MA_STATE(parent, mas->tree, mas->index, mas->last); MA_STATE(left, mas->tree, mas->index, mas->last); - MA_STATE(right , mas->tree, mas->index, mas->last); + MA_STATE(right, mas->tree, mas->index, mas->last); MA_STATE(new_p_mas, mas->tree, mas->index, mas->last); type = mte_node_type(mas->node); @@ -2357,6 +2357,7 @@ static inline int _mas_add_slot_cnt(struct ma_state *mas, if (max > mas->last) { // ends before this_slot. void *prev_val = mas_get_rcu_slot(mas, slot); + slot_cnt++; // (2 or 3?) prev_piv = max; if (!prev_val || mt_will_coalesce(prev_val)) @@ -2381,7 +2382,7 @@ static inline int __mas_add(struct ma_state *mas, void *entry, { enum maple_type mas_type = mte_node_type(mas->node); struct maple_node space; - struct maple_node* mn = NULL; + struct maple_node *mn = NULL; unsigned long wr_pivot = mas->min - 1; unsigned char coalesce; unsigned char data_end = mas_data_end(mas, mas_type, &wr_pivot, @@ -2866,7 +2867,6 @@ done: no_entry: mas->node = MAS_NONE; - return; } /** Private * mas_prev_slot() - Find the previous leaf slot, regardless of having an @@ -2920,7 +2920,6 @@ done: no_entry: mas->node = MAS_NONE; - return; } /** Private @@ -4588,14 +4587,13 @@ void mas_set_rev_index(struct ma_state *mas, unsigned long size) // last location in the search. // mas->max and mas->min is the range of the gap. // mas->index and mas->last are currently set to the search range. - + // Trim the upper limit to the max. if (gap_max > range_max) gap_max = range_max; mas->last = gap_max; mas->index = mas->last - size + 1; - return; } static void _mas_empty_or_single_unmapped_area(struct ma_state *mas, unsigned long min, unsigned long max, unsigned long size, @@ -4616,8 +4614,6 @@ static void _mas_empty_or_single_unmapped_area(struct ma_state *mas, mas->index = max - size + 1; mas->index = max; - - } static inline int _mas_get_unmapped_area(struct ma_state *mas, unsigned long min, unsigned long max, unsigned long size, bool forward) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 8352a04e8c41..a9f5ba3b57ac 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -907,7 +907,7 @@ static noinline void check_erase2_testset(struct maple_tree *mt, s_entry = mas_range_load(&mas_start, &s_min, &s_max, false); e_entry = mas_range_load(&mas_end, &e_min, &e_max, false); - switch(set[i]) { + switch (set[i]) { case SNULL: if ((s_min == set[i+1]) && (s_max == set[i+2])) entry_cnt--; -- 2.50.1