Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

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

 



On Wed, Nov 18, 2015 at 04:26:52PM +0000, Ian Abbott wrote:
> >+#define DMM32AT_AI_CFG_SCINT_10US	(BIT(5) & ~BIT(4))
> >+#define DMM32AT_AI_CFG_SCINT_5US	(BIT(5) | BIT(4))
> 
> The values of DMM32AT_AI_CFG_SCINT_20US etc. are numerically
> correct, but look a bit strange.  The `(BIT(5) & ~BIT(4))` looks
> especially strange and could be changed to `BIT(5)`.  These are all
> really shifted 2-bit values, so perhaps the BIT() macro isn't the
> best representation.
> 

BIT(5) & ~BIT(4) is silly.  Don't do that.

The original code was fine.

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