]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Staging: iio: use the BIT macro in adc
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Wed, 25 Mar 2015 23:23:29 +0000 (02:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 09:36:59 +0000 (10:36 +0100)
commit418880f5708dec9fdb2eaa7a61175fa1d8ab4110
tree37dd974f18badf1e816c33371a8c64079efbf2b8
parente273eb01feb15593d9cb3607a59d96ab12e4c0c2
Staging: iio: use the BIT macro in adc

This patch replaces bit shifting on:
0,1,2, and 3 with the BIT(x) macro.
Issue addressed by checkpatcg.pl.
This was done with the help of Coccinelle:

@r1@
identifier x;
constant int g;
@@

(
0<<\(x\|g\)
|
1<<\(x\|g\)
|
2<<\(x\|g\)
|
3<<\(x\|g\)
)

@script:python b@
g2 <<r1.g;
y;
@@
coccinelle.y = int(g2) + 1

@c@
constant int r1.g;
identifier b.y;
@@
(
-(1 << g)
+BIT(g)
|
-(0 << g)
+ 0
|
-(2 << g)
+BIT(y)
|
-(3 << g)
+(BIT(y)| BIT(g))
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/adc/ad7192.c
drivers/staging/iio/adc/ad7280a.c
drivers/staging/iio/adc/ad7780.c
drivers/staging/iio/adc/mxs-lradc.c
drivers/staging/iio/adc/spear_adc.c