Re: [PATCH] USB: UHCI: add native scatter-gather support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Sep 2010, Ming Lei wrote:

> >> +                     if (--i <= 0 || len <= 0)
> >> +                             break;
> >> +                     sg = sg_next(sg);
> >> +                     data = sg_dma_address(sg);
> >> +                     this_sg_len = min_t(int, sg_dma_len(sg), len);
> >> +             }
> >>       } while (len > 0);
> >
> > With the new "break" statement above, this doesn't need to be a "do ...
> > while" loop.  Change it to a "for (;;) {" loop.
> 
> Seems "break" can be used inside "do{...}while(...)", right?

It can.  But the "while (len > 0)" test is now unnecessary, because the 
"break" statement you added will cause the loop to end anyway whenever 
len <= 0.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux