From: Liam R. Howlett Date: Wed, 9 Sep 2020 18:12:01 +0000 (-0400) Subject: maple_tree: Update mas_next_node comments and break for end of node X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=de1b5a0d3fab4dab82543d92571bd1b1e210f4c4;p=users%2Fjedix%2Flinux-maple.git maple_tree: Update mas_next_node comments and break for end of node Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a58935b56a102..ff4fc500c640d 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]);