]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Staging: iio: use the BIT macro in .h files
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Sun, 22 Mar 2015 18:23:23 +0000 (21:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Mar 2015 21:21:58 +0000 (22:21 +0100)
commit0c76706967dd15b58dfc132d1dc46e13edb86424
tree705baa06117da9eae1cb5849b237a4c21c18dbba
parent6cf23dfffd3c69fc5cf5e2ca6fee0ab7eb316812
Staging: iio: use the BIT macro in .h files

This patch replace bit shifting on 1, 2, and 3 with the BIT(x) macro.
Issue addressed by checkpatch.pl with --strict flag.

This was done with the help of Coccninelle:

@r1@
constant int g;
@@
(
0<<g
|
1<<g
|
2<<g
|
3<<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/accel/adis16201.h
drivers/staging/iio/accel/adis16203.h
drivers/staging/iio/accel/adis16204.h
drivers/staging/iio/accel/adis16209.h
drivers/staging/iio/accel/adis16220.h
drivers/staging/iio/accel/adis16240.h
drivers/staging/iio/adc/ad7280a.h