]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix comments for mas_next_entry() and mas_prev_entry()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 14 Apr 2023 21:16:31 +0000 (17:16 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 24 Apr 2023 20:20:43 +0000 (16:20 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 297d93632134775dd7d71c6af59b2017589609d0..377b57bbe6b9b68a0ab505a1151a44a11300eebf 100644 (file)
@@ -4814,7 +4814,7 @@ retry:
  *
  * Set the @mas->node to the next entry and the range_start to
  * the beginning value for the entry.  Does not check beyond @limit.
- * Sets @mas->index and @mas->last to the limit if it is hit.
+ * Sets @mas->index and @mas->last to the limit if it is within the limit.
  * Restarts on dead nodes.
  *
  * Return: the next entry or %NULL.
@@ -4836,21 +4836,33 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit)
        return mas_next_slot(mas, limit);
 }
 
-static inline void *mas_prev_entry(struct ma_state *mas, unsigned long min)
+/*
+ * mas_prev_entry() - Internal function to get the previous entry.
+ * @mas: The maple state
+ * @limit: The minimum range start.
+ *
+ * Set the @mas->node to the previous entry and the range_start to
+ * the beginning value for the entry.  Does not check beyond @limit.
+ * Sets @mas->index and @mas->last to the limit if it is within the limit.
+ * Restarts on dead nodes.
+ *
+ * Return: the next entry or %NULL.
+ */
+static inline void *mas_prev_entry(struct ma_state *mas, unsigned long limit)
 {
        void *entry;
 
-       if (mas->index < min)
+       if (mas->index < limit)
                return NULL;
 
-       entry = mas_prev_slot(mas, min);
+       entry = mas_prev_slot(mas, limit);
        if (entry)
                return entry;
 
        if (mas_is_none(mas))
                return NULL;
 
-       return mas_prev_slot(mas, min);
+       return mas_prev_slot(mas, limit);
 }
 
 /*