*
* 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.
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);
}
/*