Commit c3eb787e authored by Liam R. Howlett's avatar Liam R. Howlett Committed by Andrew Morton

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.comSigned-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
Cc: David Binderman <dcb314@hotmail.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Vernon Yang <vernon2gm@gmail.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 633769c9
...@@ -6734,15 +6734,12 @@ static void mas_dfs_postorder(struct ma_state *mas, unsigned long max) ...@@ -6734,15 +6734,12 @@ static void mas_dfs_postorder(struct ma_state *mas, unsigned long max)
mas->node = mn; mas->node = mn;
mas_ascend(mas); mas_ascend(mas);
while (mas->node != MAS_NONE) { do {
p = mas->node; p = mas->node;
p_min = mas->min; p_min = mas->min;
p_max = mas->max; p_max = mas->max;
mas_prev_node(mas, 0); mas_prev_node(mas, 0);
} } while (!mas_is_none(mas));
if (p == MAS_NONE)
return;
mas->node = p; mas->node = p;
mas->max = p_max; mas->max = p_max;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment