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

Thunder from the hill (thunder@lightweight.ods.org)
Fri, 27 Sep 2002 14:52:38 -0600 (MDT)


Hi,

On Fri, 27 Sep 2002, Zach Brown wrote:
> > That's adding to front. One should be aware of that. The other add is
> >
> > #define slist_add(_new_in, _head_in) \
> > do { \
> > typeof(_head_in) _head = (_head_in), \
> > _new = (_new_in); \
> > _new->next = _head->next; \
> > _head->next = _new; \
> > } while (0)
>
> which is a degenerate case of slist_add_pos(), which is more
> complication than this trivial implementation needs. have you looked at
> other single linked list implementations? like glib's? do you really
> think we need that in the kernel?

Where is this complicated? I don't even have one more line than the other.
There are two positions relative to the head where we can put the list
members, one of which is before, the other is after.

Thunder

-- 
assert(typeof((fool)->next) == typeof(fool));	/* wrong */

- 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/