summaryrefslogtreecommitdiff
path: root/include/list.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-06-14 09:25:22 -0400
committerKeith Packard <keithp@keithp.com>2010-06-22 12:21:51 -0700
commit2c0159d21788b16607e6ebe4571b57fe78545c2a (patch)
treef647183fdd0dbcd8570e76fb7f28bbce4ce38e83 /include/list.h
parente2918b67395a48397bf7db545584cc2d4f4e7ccf (diff)
list.h: Fix list_for_each_entry_safe()
Can't use next as a macro argument since we're accessing the .next field of struct list. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'include/list.h')
-rw-r--r--include/list.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/list.h b/include/list.h
index 89dc29dd0..4ce20a866 100644
--- a/include/list.h
+++ b/include/list.h
@@ -94,10 +94,10 @@ list_is_empty(struct list *head)
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
-#define list_for_each_entry_safe(pos, next, head, member) \
+#define list_for_each_entry_safe(pos, tmp, head, member) \
for (pos = __container_of((head)->next, pos, member), \
- next = __container_of(pos->member.next, pos, member); \
+ tmp = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \
- pos = next, next = __container_of(next->member.next, next, member))
+ pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
#endif