Re: [PATCH][2.5] Single linked lists for Linux,v2

Rik van Riel (riel@conectiva.com.br)
Wed, 25 Sep 2002 21:08:02 -0300 (BRT)


On Wed, 25 Sep 2002, Lightweight Patch Manager wrote:

> Again single linked lists...

And again with errors ;)

> +#define INIT_SLIST_HEAD(name) \
> + (name->next = name)
> +
> +#define SLIST_HEAD(type,name) \
> + typeof(type) name = INIT_SLIST_HEAD(name)

Fun, so the list head points to itself ...

> +#define slist_for_each(pos, head) \
> + for (pos = head; pos && ({ prefetch(pos->next); 1; }); \
> + pos = pos->next)

... imagine what that would do in combination with this macro.

Rik

-- 
Bravely reimplemented by the knights who say "NIH".

http://www.surriel.com/ http://distro.conectiva.com/

Spamtraps of the month: september@surriel.com trac@trac.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/