Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Roland Dreier
> > If I just see > > > >for (pos = list_entry((head)->next, typeof(*pos), member), > >n = list_entry(pos->member.next, typeof(*pos), member); > > &pos->member != (head); > > pos = n, n = list_entry(n->member.next, typeof(*n), member)) > > > > then what am

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Pete Zaitcev
On Wed, 30 May 2007 16:42:41 -0700, Roland Dreier <[EMAIL PROTECTED]> wrote: > If I just see > > for (pos = list_entry((head)->next, typeof(*pos), member), > n = list_entry(pos->member.next, typeof(*pos), member); >&pos->member != (head); >pos = n, n =

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Roland Dreier
> > > The negative is the sheer number of helper functions in list.h. > > > Personally, > > > I find it difficult to retain a working knowledge of them. Iterators are > > > particularly nasty that way. I'm thinking about dropping all of these > > > list_for_each_with_murky_argument_requiremen

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Pete Zaitcev
On Wed, 30 May 2007 16:14:01 -0700, Roland Dreier <[EMAIL PROTECTED]> wrote: > > The negative is the sheer number of helper functions in list.h. Personally, > > I find it difficult to retain a working knowledge of them. Iterators are > > particularly nasty that way. I'm thinking about dropping

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Roland Dreier
> The negative is the sheer number of helper functions in list.h. Personally, > I find it difficult to retain a working knowledge of them. Iterators are > particularly nasty that way. I'm thinking about dropping all of these > list_for_each_with_murky_argument_requirements_and_odd_side_effects(

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Pete Zaitcev
On Thu, 31 May 2007 02:44:17 +0530, "Satyam Sharma" <[EMAIL PROTECTED]> wrote: > > > - list_for_each(p, &sc->luns) { > > > - lun = list_entry(p, struct ub_lun, link); > > > + list_for_each_entry(lun, &sc->luns, link) { > > This patch straddles the border of acceptable. The poi

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Satyam Sharma
Hi Pete, On 5/31/07, Pete Zaitcev <[EMAIL PROTECTED]> wrote: On Wed, 30 May 2007 10:47:52 +0200, Matthias Kaehlcke <[EMAIL PROTECTED]> wrote: > @@ -1608,8 +1605,7 @@ static void ub_reset_task(struct work_struct *work) > spin_lock_irqsave(sc->lock, flags); > sc->reset = 0; > ta

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Matthias Kaehlcke
El Wed, May 30, 2007 at 12:38:40PM -0700 Pete Zaitcev ha dit: > On Wed, 30 May 2007 10:47:52 +0200, Matthias Kaehlcke <[EMAIL PROTECTED]> > wrote: > > > @@ -1608,8 +1605,7 @@ static void ub_reset_task(struct work_struct *work) > > spin_lock_irqsave(sc->lock, flags); > > sc->reset = 0; >

Re: [PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Pete Zaitcev
On Wed, 30 May 2007 10:47:52 +0200, Matthias Kaehlcke <[EMAIL PROTECTED]> wrote: > @@ -1608,8 +1605,7 @@ static void ub_reset_task(struct work_struct *work) > spin_lock_irqsave(sc->lock, flags); > sc->reset = 0; > tasklet_schedule(&sc->tasklet); > - list_for_each(p, &sc->luns

[PATCH] drivers/block/ub.c: use list_for_each_entry()

2007-05-30 Thread Matthias Kaehlcke
Low performance USB storage driver: Use list_for_each_entry() instead of list_for_each() Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> -- diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 746a118..18c8b6c 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c @@ -1547,10 +1547,