[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0912142031170.14385@localhost.localdomain>
Date: Mon, 14 Dec 2009 20:36:36 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Russ Dill <russ.dill@...il.com>
cc: Greg KH <greg@...ah.com>, Alan Stern <stern@...land.harvard.edu>,
Greg KH <gregkh@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-usb@...r.kernel.org
Subject: Re: [GIT PATCH] USB patches for 2.6.33-git
On Mon, 14 Dec 2009, Russ Dill wrote:
> @@ -144,10 +144,9 @@ static int __find_interface(struct device *dev, void *data)
> return 0;
>
> intf = to_usb_interface(dev);
> - if (intf->minor != -1 && intf->minor == arg->minor) {
> - arg->interface = intf;
> + if (intf->minor != -1 && intf->minor == arg->minor &&
> + dev->driver == arg->drv)
> return 1;
> - }
> return 0;
> }
Btw, can we please write this somewhat more readably, and just do
if (dev->driver != arg->drv)
return 0;
intf = to_usb_interface(dev);
return intf->minor == arg->minor;
because the whole "intf->minor != -1" thing is pointless (we're going to
test it against 'arg->minor', and if that is -1, then the caller damn well
gets what he deserves anyway).
This way there are no complex multi-line crud expressions, and it all
looks simpler. No?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists