Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932569Ab0KODCD (ORCPT ); Sun, 14 Nov 2010 22:02:03 -0500 Received: from netrider.rowland.org ([192.131.102.5]:53497 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932493Ab0KODCC (ORCPT ); Sun, 14 Nov 2010 22:02:02 -0500 Date: Sun, 14 Nov 2010 22:01:58 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Pete Zaitcev cc: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= , Greg Kroah-Hartman , , LKML Subject: Re: [PATCH, RFC] usbmon: correct computing of the ISO packets with mmap In-Reply-To: <20101114162502.6d6318e7@lembas.zaitcev.lan> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1255 Lines: 38 On Sun, 14 Nov 2010, Pete Zaitcev wrote: > diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c > index 44cb37b..15c5e46 100644 > --- a/drivers/usb/mon/mon_bin.c > +++ b/drivers/usb/mon/mon_bin.c > @@ -437,6 +437,28 @@ static unsigned int mon_bin_get_data(const struct mon_reader_bin *rp, > return length; > } > > +/* > + * This is the look-ahead pass in case of 'Ci', when actual_length cannot > + * be used to determine the length of the whole contiguous buffer. > + */ Shouldn't the comment say "Cz" instead of "Ci"? > +static unsigned int mon_bin_collate_isodesc(const struct mon_reader_bin *rp, > + struct urb *urb, unsigned int ndesc) > +{ > + struct usb_iso_packet_descriptor *fp; > + unsigned int length; > + > + length = 0; > + fp = urb->iso_frame_desc; > + while (ndesc-- != 0) { > + if (fp->status == 0 && fp->actual_length != 0) { I'd leave out the fp->status == 0 test. It's not relevant; a buffer can contain valid data even if the final status isn't 0. Alan Stern -- 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/