From 6082ac0412a6f8cb9562234256a69587eff450bb Mon Sep 17 00:00:00 2001 From: Payal Kshirsagar Date: Tue, 2 Apr 2019 21:11:25 +0530 Subject: [PATCH] staging: iio: impedance-analyzer: ad5933.c: Replace bit shifting with BIT macro Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/impedance-analyzer/ad5933.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 3134295f014f..0922cc13e238 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -284,7 +284,7 @@ static ssize_t ad5933_show_frequency(struct device *dev, freqreg = be32_to_cpu(dat.d32) & 0xFFFFFF; freqreg = (u64)freqreg * (u64)(st->mclk_hz / 4); - do_div(freqreg, 1 << 27); + do_div(freqreg, BIT(27)); return sprintf(buf, "%d\n", (int)freqreg); } @@ -420,7 +420,7 @@ static ssize_t ad5933_store(struct device *dev, if (val > 1022) val = (val >> 2) | (3 << 9); else if (val > 511) - val = (val >> 1) | (1 << 9); + val = (val >> 1) | BIT(9); dat = cpu_to_be16(val); ret = ad5933_i2c_write(st->client,