Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359361

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

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] staging/comedi/dt282x: avoid integer overflow warning
Date 2016-03-16 22:00 +0100
Message-ID <rdqHT-5Ja-13@gated-at.bofh.it> (permalink)
References <rcJtg-1DY-15@gated-at.bofh.it> <rd5aq-7XV-17@gated-at.bofh.it> <rdn7k-3qk-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] staging/comedi/dt282x: avoid integer overflow warning Arnd Bergmann <arnd@arndb.de> - 2016-03-14 23:50 +0100
  RE: [PATCH] staging/comedi/dt282x: avoid integer overflow warning Hartley Sweeten <HartleyS@visionengravers.com> - 2016-03-15 23:00 +0100
    Re: [PATCH] staging/comedi/dt282x: avoid integer overflow warning Arnd Bergmann <arnd@arndb.de> - 2016-03-15 23:00 +0100
      RE: [PATCH] staging/comedi/dt282x: avoid integer overflow warning Hartley Sweeten <HartleyS@visionengravers.com> - 2016-03-16 18:10 +0100
        Re: [PATCH] staging/comedi/dt282x: avoid integer overflow warning Arnd Bergmann <arnd@arndb.de> - 2016-03-16 22:00 +0100

csiph-web