[stgt] [PATCH 5/6] new iser, list.h, list_for_each_prev added

Alexander Nezhinsky alexandern at Voltaire.COM
Mon Jan 24 20:38:14 CET 2011


list.h: list_for_each_prev() macro added

Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
---
 usr/list.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/usr/list.h b/usr/list.h
index f66ff36..2f80a56 100644
--- a/usr/list.h
+++ b/usr/list.h
@@ -43,6 +43,9 @@ static inline int list_empty(const struct list_head *head)
 #define list_for_each(pos, head) \
 	for (pos = (head)->next; pos != (head); pos = pos->next)
 
+#define list_for_each_prev(pos, head) \
+	for (pos = (head)->prev; pos != (head); pos = pos->prev)
+
 #define list_for_each_entry(pos, head, member)				\
 	for (pos = list_entry((head)->next, typeof(*pos), member);	\
 	     &pos->member != (head);				 	\
--
1.6.5.5
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list