Messages in this thread |  | | | Date | Mon, 23 Mar 2009 09:33:33 +0100 | | From | Ingo Molnar <> | | Subject | Re: [PATCH] tracing/filters: use list_for_each_entry_safe |
| |
* Li Zefan <lizf@cn.fujitsu.com> 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
|  |