Re: [Patch] usbmon: correct length for isochronous

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

 



On Wed, Nov 17, 2010 at 12:20:47PM -0700, Pete Zaitcev wrote:
> On Wed, 17 Nov 2010 15:29:47 +0300
> Sergei Shtylyov <sshtylyov@xxxxxxxxxx> wrote:
> 
> > > +	length = 0;
> > > +	fp = urb->iso_frame_desc;
> > > +	while (ndesc-- != 0) {
> > > +		if (fp->actual_length != 0) {
> > > +			if (fp->offset + fp->actual_length > length)
> > > +				length = fp->offset + fp->actual_length;
> > > +		}
> > 
> >     {} are not needed here, and thwo *if* statements can be collapsed into one.
> 
> They are semantically different and thus they were left uncollaplsed.
> The upper one selects the descriptor and the lower own is an
> open-coded min. Also, any collapsing would lead to hideously ugly
> continuation lines.

What about doing the internal if() with a MIN() instead?  It looks
equivalent to 
	length = MIN(length, fp->offset + fp->actual_length);

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@xxxxxxxxxxxxxxxxxx 
Maintainer, Linux USB Mass Storage Driver

Oh great modem, why hast thou forsaken me?
					-- Dust Puppy
User Friendly, 3/2/1998

Attachment: pgpwlGjZj95Oh.pgp
Description: PGP signature


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

  Powered by Linux