list: add list previous iterator

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2017-06-06 16:41:35 +01:00
parent 69222cf7d7
commit 405b1f34f2
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,10 @@ static inline int list_item_is_last(struct list_item *item,
#define list_for_item(item, list) \
for (item = (list)->next; item != (list); item = item->next)
/* list iterator */
#define list_for_item_prev(item, list) \
for (item = (list)->prev; item != (list); item = item->prev)
/* list iterator - safe to delete items */
#define list_for_item_safe(item, tmp, list) \
for (item = (list)->next, tmp = item->next;\