Re: [PATCH] staging/comedi/dt282x: avoid integer overflow warning

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

 



On Wednesday 16 March 2016 17:04:15 Hartley Sweeten wrote:
> > #define DT2821_SUPCSR_DS_AD_TRIG       (3 << 10)
> 
> Use a helper macro for those bits:
> 
> #define DT2821_SUPCSR_DS(x)             (((x) & 0x3) << 10)
> #define DT2821_SUPCSR_DS_PIO            DT2821_SUPCSR_DS(0)
> #define DT2821_SUPCSR_DS_AD_CLK         DT2821_SUPCSR_DS(1)
> #define DT2821_SUPCSR_DS_DA_CLK         DT2821_SUPCSR_DS(2)
> #define DT2821_SUPCSR_DS_AD_TRIG                DT2821_SUPCSR_DS(3)
> 
> > I considered using BIT() but decided against it for consistency.
> 
> Your change may fix the gcc-6 issue but it doesn't fix the 28 checkpatch.pl
> issues:
> CHECK: Prefer using the BIT macro

I sent a new version now, and found a better solution that avoids
using BIT().

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