summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/list.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/list.h b/include/list.h
index 39f198590..1accf1096 100644
--- a/include/list.h
+++ b/include/list.h
@@ -304,7 +304,8 @@ xorg_list_is_empty(struct xorg_list *head)
* @param member Member name of the struct xorg_list in the list elements.
*
*/
-#define xorg_list_for_each_entry(pos, head, member) \
+#define xorg_list_for_each_entry(pos, head, member) \
+ pos = NULL; \
for (pos = __container_of((head)->next, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
@@ -317,6 +318,7 @@ xorg_list_is_empty(struct xorg_list *head)
* See xorg_list_for_each_entry for more details.
*/
#define xorg_list_for_each_entry_safe(pos, tmp, head, member) \
+ pos = NULL; \
for (pos = __container_of((head)->next, pos, member), \
tmp = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \