From: Liam R. Howlett Date: Mon, 17 Apr 2023 18:28:25 +0000 (-0400) Subject: maple_tree: Clean up mas_dfs_postorder() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d83434d6cb532aac0afcf00c86e91966fd6fe0e4;p=users%2Fjedix%2Flinux-maple.git maple_tree: Clean up mas_dfs_postorder() 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 --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index cb8647c010a9..e2cbd39fca7f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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;