From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>,
Shraddha Barke <shraddha.6596@gmail.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
linux-iio@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH 1/2] Staging: iio: cdc: Prefer using the BIT macro
Date: Sun, 27 Sep 2015 14:46:10 +0100 [thread overview]
Message-ID: <5607F322.8040504@kernel.org> (raw)
In-Reply-To: <5606D264.6080503@metafoo.de>
On 26/09/15 18:14, Lars-Peter Clausen wrote:
> On 09/25/2015 07:23 PM, Shraddha Barke wrote:
>> Replace bit shifting on 1 with the BIT(x) macro
>>
>> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
>
This is a good little patch, so applied to the togreg branch
of iio.git. This will get initially pushed out as testing
and the branch will get rebased onto Greg KH's staging-next
branch sometime soon.
However, I think there are some other places the BIT macro
can be correctly used in this driver if you are willing to take
it further.
Note that you can only do these by checking the datasheet to be
sure we aren't writing part of a large field in the register!
In the status register the bottom for bits are single bit fields.
#define AD7746_STATUS_EXCERR (1 << 3)
#define AD7746_STATUS_RDY (1 << 2)
#define AD7746_STATUS_RDYVT (1 << 1)
#define AD7746_STATUS_RDYCAP (1 << 0)
As are the cap setup register bits
#define AD7746_CAPSETUP_CAPEN (1 << 7)
#define AD7746_CAPSETUP_CIN2 (1 << 6) /* AD7746 only */
#define AD7746_CAPSETUP_CAPDIFF (1 << 5)
#define AD7746_CAPSETUP_CACHOP (1 << 0)
Some of the vt setup register are also single bits but as that register
is a more complex mess and some other bits are hard to define macros
for perhaps leave it alone. It's another one arguing in favour of
a ZERO(bit) macro but I fear persuading people of that will be an uphill
struggle :(
Anyhow the two registers mentioned above are a clear cut as the one you've
done so perhaps tidy those up as well?
Thanks,
Jonathan
next prev parent reply other threads:[~2015-09-27 13:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 17:23 [PATCH 0/2] Staging: iio: cdc: Use BIT macro and remove dev_info Shraddha Barke
2015-09-25 17:23 ` [PATCH 1/2] Staging: iio: cdc: Prefer using the BIT macro Shraddha Barke
2015-09-26 17:14 ` Lars-Peter Clausen
2015-09-27 13:46 ` Jonathan Cameron [this message]
2015-09-27 19:39 ` Shraddha Barke
2015-09-29 17:36 ` Jonathan Cameron
2015-09-25 17:23 ` [PATCH 2/2] Staging: iio: cdc: Remove unnecessary dev_info Shraddha Barke
2015-09-26 17:14 ` Lars-Peter Clausen
2015-09-27 13:47 ` Jonathan Cameron
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=5607F322.8040504@kernel.org \
--to=jic23@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=shraddha.6596@gmail.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).