lkml.org 
[lkml]   [2005]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/16] GFS: core fs
On Tue, Oct 11, 2005 at 02:15:25PM +0200, Jan Hudec wrote:
> On Mon, Oct 10, 2005 at 23:39:28 +0200, Pavel Machek wrote:

> > > + for (head = &ai->ai_ail1_list, tmp = head->prev, prev = tmp->prev;
> > > + tmp != head;
> > > + tmp = prev, prev = tmp->prev) {
> >
> >

> > > + for (head = &ai->ai_ail1_list, tmp = head->prev, prev = tmp->prev;
> > > + tmp != head;
> > > + tmp = prev, prev = tmp->prev) {
> >
> >
> > Can you get less creative in the for loops? [There are more examples
> > at other patches, for (i=something; i--; ) was "nicest" example].
>
> The later two are good examples of where list_for_each_safe is
> appropriate.

There are multiple places like this that need either a
list_for_each_entry_reverse_safe or list_for_each_prev_safe, neither of
which exist. I'll send a patch to add one.

I've just converted to a macro in ail2_empty() -- I'm not sure why I'd
left it out in that spot, maybe to be consistent with ail1_empty above.

Thanks,
Dave

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

\
 
 \ /
  Last update: 2005-10-11 16:58    [W:0.059 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site