On 08/03/13(Fri) 10:14, Mark Kettenis wrote:
> > Date: Fri, 8 Mar 2013 09:55:07 +0100
> > From: Martin Pieuchot <[email protected]>
> >
> > On 07/03/13(Thu) 22:32, Claudio Jeker wrote:
> > > On Thu, Mar 07, 2013 at 04:23:34PM -0500, Ted Unangst wrote:
> > > > Maybe I'm just easily confused, but when I see LIST_END() I tend to
> > > > think it's going to be the last element in the list. I think NULL is
> > > > clearer. As per the man page, "The SLIST_END(), LIST_END(),
> > > > SIMPLEQ_END() and TAILQ_END() macros are provided for symmetry
> > > > with CIRCLEQ_END(). They expand to NULL and don't serve any
> > > > useful purpose."
> > > >
> > > > There are very few CIRCLEQs in the kernel, and I consider it unlikely
> > > > that we'd ever convert some of the existing lists to them, so I'd like
> > > > to zap some of the LIST_END macros. As so:
> > > >
> > > > Strong opinions?
> > >
> > > Yes! Please do. OK claudio@
> >
> > ok mpi@, and please can you also remove them from queue.h?
>
> There's code out there that relies on these defines so you can't
> remove them from queue.h.
Sure, I'm unclear. I don't want to remove the define, but I was thinking
of converting the tests in the TAILQ_FOREACH() loops and friends.
#define TAILQ_FOREACH(var, head, field) \
for((var) = TAILQ_FIRST(head); \
- (var) != TAILQ_END(head); \
+ (var) != NULL; \
(var) = TAILQ_NEXT(var, field))
M.