exec_list: add a list_foreach_typed_reverse() macro

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Connor Abbott 2014-07-21 17:11:53 -07:00 committed by Jason Ekstrand
parent 84ef2d4156
commit ab2ae63854
1 changed files with 6 additions and 0 deletions

View File

@ -665,6 +665,12 @@ inline void exec_node::insert_before(exec_list *before)
(__node)->__field.next != NULL; \
(__node) = exec_node_data(__type, (__node)->__field.next, __field))
#define foreach_list_typed_reverse(__type, __node, __field, __list) \
for (__type * __node = \
exec_node_data(__type, (__list)->tail_pred, __field); \
(__node)->__field.prev != NULL; \
(__node) = exec_node_data(__type, (__node)->__field.prev, __field))
#define foreach_list_typed_safe(__type, __node, __field, __list) \
for (__type * __node = \
exec_node_data(__type, (__list)->head, __field), \