maple_tree: Clean up mas_dfs_postorder()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 17 Apr 2023 18:28:25 +0000 (14:28 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 24 Apr 2023 15:40:43 +0000 (11:40 -0400)
Convert loop type to ensure all variables are set to make the compiler
happy, and use the mas_is_none() function instead of explicitly checking
the node in the maple state.

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

index 60bae5be008a67da62ec4bd840266c2e966bd738..dcab027b734405f0af938629f10f37ff7b7abbc9 100644 (file)
@@ -6740,15 +6740,12 @@ static void mas_dfs_postorder(struct ma_state *mas, unsigned long max)
 
        mas->node = mn;
        mas_ascend(mas);
-       while (mas->node != MAS_NONE) {
+       do {
                p = mas->node;
                p_min = mas->min;
                p_max = mas->max;
                mas_prev_node(mas, 0);
-       }
-
-       if (p == MAS_NONE)
-               return;
+       } while (!mas_is_none(mas));
 
        mas->node = p;
        mas->max = p_max;