RE: [staging-next 4/4] staging/easycap: use USB_SUBCLASS_AUDIOSTREAMING instead of 0x02

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

 




> -----Original Message-----
> From: Dan Carpenter [mailto:error27@xxxxxxxxx]
> Sent: Monday, February 21, 2011 3:58 PM
> To: Winkler, Tomas
> Cc: gregkh@xxxxxxx; devel@xxxxxxxxxxxxxxxxxxxxxx; Mike Thomas
> Subject: Re: [staging-next 4/4] staging/easycap: use
> USB_SUBCLASS_AUDIOSTREAMING instead of 0x02
> 
> On Mon, Feb 21, 2011 at 01:23:28PM +0200, Tomas Winkler wrote:
> >  	} else if ((USB_CLASS_AUDIO == bInterfaceClass) &&
> > -		   (0x02 == bInterfaceSubClass)) {
> > +		   (USB_SUBCLASS_AUDIOSTREAMING == bInterfaceSubClass)) {
> >  		if (-1 == peasycap->audio_interface) {
> >  			peasycap->audio_interface = bInterfaceNumber;
> >  			JOM(4, "setting peasycap->audio_interface=%i\n",
> > @@ -3654,7 +3655,8 @@ static int easycap_usb_probe(struct usb_interface
> *pusb_interface,
> >  						break;
> >  					}
> >  					case USB_CLASS_AUDIO: {
> > -						if (0x02 != bInterfaceSubClass)
> > +						if (bInterfaceClass !=
> > +						    USB_SUBCLASS_AUDIOSTREAMING)
> 
> Btw. I would have swapped the order on the first one as well.  This
> whole driver is full of Yoda style if statements...
> 
> I reviewed all four patches.

This style should prevent typos in assignment vs. comparison...cannot assign to a constant, I don't like the style but that's just personal taste. I switched the order just to fit into 80 columns, which is pathetic too. 
Last, this all code will go out anyhow this is not how to handle multi interface USB devices. I'm performing these small changes just to understand the code better so when I'll move code around I know what I'm doing.

Anyhow I need to resend this because of autocompletion bug I've bInterfaceClass -> bInterfaceSubClass

Thanks
Tomas

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux