From: Arnd Bergmann <arnd@arndb.de>
To: Hartley Sweeten <HartleyS@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Amitoj Kaur Chawla <amitoj1606@gmail.com>,
Bhaktipriya Shridhar <bhaktipriya96@gmail.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging/comedi/dt282x: avoid integer overflow warning
Date: Wed, 16 Mar 2016 21:52:30 +0100 [thread overview]
Message-ID: <292158977.4HS03to08B@wuerfel> (raw)
In-Reply-To: <BY1PR0101MB1063BC66A03676338F5B1B36D08A0@BY1PR0101MB1063.prod.exchangelabs.com>
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
prev parent reply other threads:[~2016-03-16 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 22:48 [PATCH] staging/comedi/dt282x: avoid integer overflow warning Arnd Bergmann
2016-03-15 21:35 ` Hartley Sweeten
2016-03-15 21:50 ` Arnd Bergmann
2016-03-16 17:04 ` Hartley Sweeten
2016-03-16 20:52 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=292158977.4HS03to08B@wuerfel \
--to=arnd@arndb.de \
--cc=HartleyS@visionengravers.com \
--cc=abbotti@mev.co.uk \
--cc=amitoj1606@gmail.com \
--cc=bhaktipriya96@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox