summaryrefslogtreecommitdiffstats
path: root/lib/maple_tree.c
diff options
context:
space:
mode:
authorLiam R. Howlett <Liam.Howlett@oracle.com>2023-05-18 16:55:13 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-06-10 01:25:28 +0200
commitc3eb787e88e486eefcfafbf990df32c75018ca92 (patch)
tree5255dc6a9dcc63895d99089d9ce80fabc84e1e69 /lib/maple_tree.c
parentmaple_tree: avoid unnecessary ascending (diff)
downloadlinux-c3eb787e88e486eefcfafbf990df32c75018ca92.tar.xz
linux-c3eb787e88e486eefcfafbf990df32c75018ca92.zip
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 <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: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/maple_tree.c')
-rw-r--r--lib/maple_tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index ccd834d624ed..e095e2c39a1b 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;