Re: [PATCH 1/2] list: add list_del_each_entry

2013-07-15 Thread Jörn Engel
On Fri, 5 July 2013 23:38:01 +0100, Filipe David Manana wrote: > > > +#define list_del_each_entry(pos, head, member) \ > > + while (list_empty(head) && (pos = list_first_entry((head), \ > > + typeof(*pos), member), list_del((head)->next), 1)) > > + > > Shouldn't it be while (!l

Re: [PATCH 1/2] list: add list_del_each_entry

2013-07-05 Thread Filipe David Manana
On Fri, Jul 5, 2013 at 9:41 PM, Jörn Engel wrote: > I have seen a lot of boilerplate code that either follows the pattern of > while (!list_empty(head)) { > pos = list_entry(head->next, struct foo, list); > list_del(pos->list); > ... >