core: lists: new list iterators in reverse mode foreach_r() and foreach_safe_r()
@@ -142,6 +142,11 @@ static inline void mk_list_cat(struct mk_list *list, struct mk_list *head)
#define mk_list_foreach_safe(curr, n, head) \
for (curr = (head)->next, n = curr->next; curr != (head); curr = n, n = curr->next)
+
+#define mk_list_foreach_r(curr, head) for( curr = (head)->prev; curr != (head); curr = curr->prev )
+#define mk_list_foreach_safe_r(curr, n, head) \
+ for (curr = (head)->prev, n = curr->prev; curr != (head); curr = n, n = curr->prev)
+
#define mk_list_entry( ptr, type, member ) container_of( ptr, type, member )
/*
