lkml.org 
[lkml]   [2009]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2009-03-23 09:37    [from the cache]
©2003-2011 Jasper Spaans