From: Liam R. Howlett Date: Thu, 18 May 2023 14:55:13 +0000 (-0400) Subject: maple_tree: clean up mas_dfs_postorder() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c3eb787e88e486eefcfafbf990df32c75018ca92;p=linux.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. Link: https://lkml.kernel.org/r/20230518145544.1722059-5-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ccd834d624ed7..e095e2c39a1bd 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6734,15 +6734,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;