summaryrefslogtreecommitdiff
path: root/src/intel_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel_list.h')
-rw-r--r--src/intel_list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel_list.h b/src/intel_list.h
index d0408bed..df912a83 100644
--- a/src/intel_list.h
+++ b/src/intel_list.h
@@ -347,6 +347,11 @@ list_is_empty(const struct list *head)
&pos->member != (head); \
pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
+#define list_for_each_entry_safe_from(pos, tmp, head, member) \
+ for (tmp = __container_of(pos->member.next, pos, member); \
+ &pos->member != (head); \
+ pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
+
#else
#include <list.h>
@@ -396,6 +401,11 @@ static inline void list_move_tail(struct list *list, struct list *head)
&pos->member != (head); \
pos = __container_of(pos->member.prev, pos, member))
+#define list_for_each_entry_safe_from(pos, tmp, head, member) \
+ for (tmp = __container_of(pos->member.next, pos, member) \
+ &pos->member != (head); \
+ pos = tmp)
+
#endif
#undef container_of