]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Small code cleanup, white spaces etc.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 2 Mar 2020 19:54:06 +0000 (14:54 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:03:33 +0000 (15:03 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c
lib/test_maple_tree.c

index d6eaeac816b0912ac8680d791986bf88f716fcd7..3a2ad10b4e5caff914720f08762e2500118f1e17 100644 (file)
@@ -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_nodemn = 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)
index 8352a04e8c41c217fc7aa4db9f7437038ffc959c..a9f5ba3b57ac456b66ab05522a174af853ab72fb 100644 (file)
@@ -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--;