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]

 



On Mon, Feb 21, 2011 at 04:07:50PM +0200, Winkler, Tomas wrote:
> > 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. 

Yes.  That is pathetic.  I wish I could tell you to ignore the 80 char
limit where it doesn't make sense, but unfortunately someone will just
come along after you and break up the line anyway.

In gcc there is already a warning if you accidentally have assign
something instead of doing a compare.  It's turned on with -Wall so
the kernel has it enabled.  "if (x = 42) { ..." leads to "warning: 
suggest parentheses around assignment used as truth value".  If you want
an assignment, you have to write it like "if ((x = 42)) { ..."

There is a first time for everything, of course, but I've never seen
an assignment used instead of a compare in kernel code.  There's no good
reason to write Yoda style code.

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

I'm glad it's you and not me.  Good luck.  ;)

regards,
dan carpenter

_______________________________________________
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