1
0

list: Don't leave out last element in for_each_list()

This commit is contained in:
Aaron Lindsay 2012-09-28 00:59:38 -04:00
parent 580ab1f584
commit d7292f1fe2

View File

@ -36,10 +36,10 @@
* to each element in the list, in turn.
*/
#define for_each_list(it, head, parent_type, member) \
for (it = container((head)->next, parent_type, member); it->member.next != (head); it = container(it->member.next, parent_type, member))
for (it = container((head)->next, parent_type, member); &it->member != (head); it = container(it->member.next, parent_type, member))
#define for_each_list_noinit(it, head, parent_type, member) \
for (; it->member.next != (head); it = container(it->member.next, parent_type, member))
for (; &it->member != (head); it = container(it->member.next, parent_type, member))
struct dlist_node {
struct dlist_node *next, *prev;