]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Update mas_next_node comments and break for end of node
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 9 Sep 2020 18:12:01 +0000 (14:12 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:11:30 +0000 (15:11 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index a58935b56a10208431ed1b8be5ca16a03fec4e32..ff4fc500c640d1abd8d85be111904d5342d728ff 100644 (file)
@@ -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]);