[PATCH] list: fix list macro to not require variables named next.
Dave Airlie
airlied at gmail.com
Thu Jul 1 21:51:11 PDT 2010
From: Dave Airlie <airlied at redhat.com>
If you didn't call the temp variable for the macro, next, it wouldn't
actually work.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
include/list.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/list.h b/include/list.h
index 89dc29d..f80adb0 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, storage, head, member) \
for (pos = __container_of((head)->next, pos, member), \
- next = __container_of(pos->member.next, pos, member); \
+ storage = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \
- pos = next, next = __container_of(next->member.next, next, member))
+ pos = storage, storage = __container_of(storage->member.next, storage, member))
#endif
--
1.7.1
More information about the xorg-devel
mailing list