diff options
author | Cristina Opriceana <cristina.opriceana@gmail.com> | 2015-03-14 18:51:12 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-16 15:14:05 (GMT) |
commit | f1d05b5f68cbe370b13a4432be5aa11ffc226dec (patch) | |
tree | 039af53584de22f7a0552b8a8e625a8afdb3c972 /drivers/staging/iio/frequency/ad9834.c | |
parent | 6970791fd5683a893bc11bb4722b82d899013465 (diff) | |
download | linux-f1d05b5f68cbe370b13a4432be5aa11ffc226dec.tar.xz |
Staging: iio: Prefer using the BIT macro
This patch replaces bit shifting on 1 with the BIT(x) macro
as it's extensively used by other function in this driver.
This was done with coccinelle:
@@ int g; @@
-(1 << g)
+BIT(g)
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/frequency/ad9834.c')
-rw-r--r-- | drivers/staging/iio/frequency/ad9834.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index efea560..342c713 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -27,7 +27,7 @@ static unsigned int ad9834_calc_freqreg(unsigned long mclk, unsigned long fout) { - unsigned long long freqreg = (u64)fout * (u64)(1 << AD9834_FREQ_BITS); + unsigned long long freqreg = (u64)fout * (u64)BIT(AD9834_FREQ_BITS); do_div(freqreg, mclk); return freqreg; @@ -55,7 +55,7 @@ static int ad9834_write_frequency(struct ad9834_state *st, static int ad9834_write_phase(struct ad9834_state *st, unsigned long addr, unsigned long phase) { - if (phase > (1 << AD9834_PHASE_BITS)) + if (phase > BIT(AD9834_PHASE_BITS)) return -EINVAL; st->data = cpu_to_be16(addr | phase); |