summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index a724f9bcbe4d..11b8674c14ff 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -437,6 +437,10 @@ static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node
for (pos = (head)->first; pos; \
pos = pos->next)
+#define hlist_for_each_safe(pos, n, head) \
+ for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
+ pos = n)
+
#else
#warning "don't include kernel headers in userspace"
#endif /* __KERNEL__ */