Re: [GIT PATCH] USB patches for 2.6.33-git

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

 




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-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