From beca967a2cbd627b16b86d3e45fa8d32c3643474 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 9 Sep 2020 14:12:01 -0400 Subject: [PATCH] maple_tree: Update mas_next_node comments and break for end of node Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a58935b56a10..ff4fc500c640 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3226,11 +3226,14 @@ no_entry: } /* - * Find the next non-null entry at the same level in the tree. The next value - * will be mas->node[mas_offset(mas)] or MAS_NONE. + * mas_next_node() - Get the next node at the same level in the tree. + * @mas: The maple state + * @max: The maximum pivot value to check. * + * Returns: The next value will be mas->node[mas_offset(mas)] or MAS_NONE. * - * Node: Not safe to call with mas->node == root + * Finds the next non-null entry at the same level in the tree. Slot is passed + * in the maple state offset, eg: mas_set_offset(mas, offset) */ static inline unsigned long mas_next_node(struct ma_state *mas, @@ -3269,7 +3272,7 @@ restart_next_node: if (prev_piv > max) goto no_entry; - if (offset!= 0 && pivot == 0) + if (!pivot && offset) break; mn = rcu_dereference(slots[offset]); -- 2.50.1