From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755272AbbKRINP (ORCPT ); Wed, 18 Nov 2015 03:13:15 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:33855 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752542AbbKRINN (ORCPT ); Wed, 18 Nov 2015 03:13:13 -0500 Date: Wed, 18 Nov 2015 09:12:47 +0100 From: Dave Penkler To: Andy Shevchenko Cc: Greg Kroah-Hartman , peter.chen@freescale.com, teuniz@gmail.com, USB , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v4 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation. Message-ID: <20151118081247.GA1776@slacky> References: <20151115183438.GA1585@slacky> <20151115183913.GA1592@slacky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Sun, Nov 15, 2015 at 10:04:10PM +0200, Andy Shevchenko wrote: > On Sun, Nov 15, 2015 at 8:39 PM, Dave Penkler wrote: snip > > + > > Redundant empty line. > ok > > > + data->iin_bTag = 2; > > Hmm??? Why 2? > A-ha, below I found a comment. Something might be good to have here as well. > Added comment > > + > > Redundant empty line. > ok > > + > > + if (data->iin_buffer[0] & 0x80) { > > + /* check for valid STB notification */ > > + if ((data->iin_buffer[0] & 0x7f) > 1) { > > It's the same as > if (data->iin_buffer[0] & 0x7e) { > Yes but when reading the spec and the code it is more obvious that here we are testing for the value in bits D6..D0 to be a valid iin_bTag return. (See Table 7 in the USBTMC-USB488 spec.) > > + dev_dbg(&data->intf->dev, > > + "%s - urb terminated, status: %d\n", > > I heard that dynamic debug adds function name. > > > + __func__, status); I checked in device.h and could not find any trace of it. I'm on 4.4.0-rc1. > > +static void usbtmc_free_int(struct usbtmc_device_data *data) > > +{ > > + if (data->iin_ep_present) { > > + if (data->iin_urb) { > > Why not > > if (!data->iin_ep_present || !data->iin_urb) > return; > > ? > OK Thanks, -Dave