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

Matthew Wilcox (willy@debian.org)
Fri, 4 Oct 2002 17:00:21 +0100


On Fri, Oct 04, 2002 at 10:48:33AM -0500, Mark Peloquin wrote:
> list_empty() can be used on check list heads *or*
> to check if a list element is currently in a list,
> assuming the coder uses list_del_init(). However,
> if the coder chooses to use list_del() [which sets
> the prev and next fields to 0] instead, there is no
> corresponding function to indicate if that element
> is currently on a list. This function does that.

That behaviour for list_del is new and, IMNSHO, bogus. There's now _zero_
gain in using list_del instead of list_del_init. akpm changed it about
5 months ago with a comment that says:

"list_head debugging"

so i think it's pretty safe to assume that this behaviour will not
remain into 2.6. if you think you want list_member, use list_del_init
and list_empty() instead.

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