Re: [PATCH] add safe version of list_for_each_entry() to list.h

From: Matthew Wilcox (willy@debian.org)
Date: Fri Oct 04 2002 - 10:05:43 EST


Your list_member macro:

+static inline int list_member(struct list_head *member)
+{
+ return ((!member->next || !member->prev) ? 0 : 1);
+}

seems wrong to me. A list head which has been removed from its list using
list_del() still points to its old prev & next entries. If removed using
list_del_init(), those pointers are reinitialised to point at itself.
ie you only need list_empty(). Are you abusing list.h somehow?

-- 
Revolutions do not require corporate support.
-
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/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:45 EST