From: Arnd Bergmann <arnd@arndb.de>
To: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: outreachy-kernel@googlegroups.com,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Teddy Wang <teddy.wang@siliconmotion.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: staging: iio: Replace a bit shift by a use of BIT.
Date: Wed, 22 Mar 2017 08:53:02 +0000 [thread overview]
Message-ID: <CAK8P3a2sKZK7mRsWKnLsz6b9TYy_LdxhVCUnxUpkEOHZRDrdpA@mail.gmail.com> (raw)
In-Reply-To: <20170322024942.GA21242@arushi-HP-Pavilion-Notebook>
On Wed, Mar 22, 2017 at 3:49 AM, Arushi Singhal
<arushisinghal19971997@gmail.com> wrote:
> @@ -232,7 +232,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
> if (ret < 0)
> goto error_ret;
>
> - cfg = ret & ~((0x03 << 5) | (0x1 << 7));
> + cfg = ret & ~((0x03 << 5) | (BIT(7)));
>
> switch (type) {
> case IIO_EV_TYPE_MAG_ADAPTIVE:
While the change in the #defines is not unusual, this particular change
here makes it harder to read, so I'd recommend leaving it alone, or changing
it to use symbolic names instead of the bit masks.
> /* Voltage/Temperature Setup Register Bit Designations (AD7746_REG_VT_SETUP) */
> -#define AD7746_VTSETUP_VTEN (1 << 7)
> +#define AD7746_VTSETUP_VTEN (BIT(7))
> #define AD7746_VTSETUP_VTMD_INT_TEMP (0 << 5)
> -#define AD7746_VTSETUP_VTMD_EXT_TEMP (1 << 5)
> +#define AD7746_VTSETUP_VTMD_EXT_TEMP (BIT(5))
Why did you leave one of them unchanged?
Arnd
next prev parent reply other threads:[~2017-03-22 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 2:49 staging: iio: Replace a bit shift by a use of BIT Arushi Singhal
2017-03-22 6:01 ` Greg Kroah-Hartman
2017-03-22 8:53 ` Arnd Bergmann [this message]
2017-03-22 9:41 ` Dan Carpenter
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=CAK8P3a2sKZK7mRsWKnLsz6b9TYy_LdxhVCUnxUpkEOHZRDrdpA@mail.gmail.com \
--to=arnd@arndb.de \
--cc=arushisinghal19971997@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.com \
/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;
as well as URLs for NNTP newsgroup(s).