From: Bhumika Goyal <bhumirks@gmail.com>
To: lars@metafoo.de, gregkh@linuxfoundation.org,
Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de,
pmeerw@pmeerw.net
Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, Bhumika Goyal <bhumirks@gmail.com>
Subject: [PATCH 2/2] Staging: iio: adc: Prefer using the BIT macro
Date: Mon, 8 Feb 2016 12:18:57 +0530 [thread overview]
Message-ID: <9d77eec44a1f7223c2482ebe3c7df1f90d96aa9a.1454913458.git.bhumirks@gmail.com> (raw)
In-Reply-To: <cover.1454913458.git.bhumirks@gmail.com>
In-Reply-To: <cover.1454913458.git.bhumirks@gmail.com>
This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@ int g; @@
-(1 << g)
+BIT(g)
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/staging/iio/adc/ad7280a.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 0c73bce..ccf3157 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -117,7 +117,7 @@
*/
#define POLYNOM 0x2F
#define POLYNOM_ORDER 8
-#define HIGHBIT (1 << (POLYNOM_ORDER - 1))
+#define HIGHBIT BIT((POLYNOM_ORDER - 1))
struct ad7280_state {
struct spi_device *spi;
@@ -388,7 +388,7 @@ static ssize_t ad7280_show_balance_sw(struct device *dev,
return sprintf(buf, "%d\n",
!!(st->cb_mask[this_attr->address >> 8] &
- (1 << ((this_attr->address & 0xFF) + 2))));
+ BIT(((this_attr->address & 0xFF) + 2))));
}
static ssize_t ad7280_store_balance_sw(struct device *dev,
--
1.9.1
next prev parent reply other threads:[~2016-02-08 6:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 6:48 [PATCH 0/2] Staging:iio:adc:Prefer using BIT macro Bhumika Goyal
2016-02-08 6:48 ` [PATCH 1/2] Staging:iio:Prefer " Bhumika Goyal
2016-02-08 9:14 ` Lars-Peter Clausen
2016-02-08 15:11 ` Andy Shevchenko
2016-02-08 6:48 ` Bhumika Goyal [this message]
2016-02-08 9:16 ` [PATCH 2/2] Staging: iio: adc: Prefer using the " Lars-Peter Clausen
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=9d77eec44a1f7223c2482ebe3c7df1f90d96aa9a.1454913458.git.bhumirks@gmail.com \
--to=bhumirks@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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).