Re: [PATCH 2/3] staging: lustre: fix pointer whitespace style

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

 



On Sat, Sep 06, 2014 at 11:19:03AM -0700, Joe Perches wrote:
> 
> Indexing a string array with an enum is generally unsafe.
> 
> I think it better to use a switch/case like:
> 

The reverse side of that argument is that switch statements are slower
and uglier.

My understanding is that according to the c spec, "state" could be
signed but in this case GCC defines it as unsigned int.  So the ASSERT
is ok in real life, but in theory it should check for negatives as well.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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