Re: [PATCH] tracing/filters: use list_for_each_entry_safe

From: Ingo Molnar
Date: Mon Mar 23 2009 - 04:34:25 EST



* Li Zefan <lizf@xxxxxxxxxxxxxx> wrote:

> > - list_for_each_safe(entry, tmp, &call->fields) {
> > - field = list_entry(entry, struct ftrace_event_field, link);
> > + list_for_each_entry_safe(field, next, &call->fields, link) {
>
> Why we need _safe version ?

indeed the plain list_for_each_entry() variant would be fine, as the
list is only walked, not modified:

> > if (!strcmp(field->name, name))
> > return field;
> > }

(I've applied this patch already as it was a step forward - so
please enhance this in the next round of cleanups via a delta patch
- thanks!)

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