diff options
author | Haneen Mohammed <hamohammed.sa@gmail.com> | 2015-03-22 21:23:23 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-24 00:21:58 +0300 |
commit | 0c76706967dd15b58dfc132d1dc46e13edb86424 (patch) | |
tree | 705baa06117da9eae1cb5849b237a4c21c18dbba /drivers/staging/iio/adc | |
parent | 6cf23dfffd3c69fc5cf5e2ca6fee0ab7eb316812 (diff) | |
download | linux-0c76706967dd15b58dfc132d1dc46e13edb86424.tar.xz |
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>
Diffstat (limited to 'drivers/staging/iio/adc')
-rw-r--r-- | drivers/staging/iio/adc/ad7280a.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/iio/adc/ad7280a.h b/drivers/staging/iio/adc/ad7280a.h index 20400b0045e5..732347a9bce4 100644 --- a/drivers/staging/iio/adc/ad7280a.h +++ b/drivers/staging/iio/adc/ad7280a.h @@ -23,10 +23,10 @@ #define AD7280A_CONV_AVG_4 2 #define AD7280A_CONV_AVG_8 3 -#define AD7280A_ALERT_REMOVE_VIN5 (1 << 2) -#define AD7280A_ALERT_REMOVE_VIN4_VIN5 (2 << 2) -#define AD7280A_ALERT_REMOVE_AUX5 (1 << 0) -#define AD7280A_ALERT_REMOVE_AUX4_AUX5 (2 << 0) +#define AD7280A_ALERT_REMOVE_VIN5 BIT(2) +#define AD7280A_ALERT_REMOVE_VIN4_VIN5 BIT(3) +#define AD7280A_ALERT_REMOVE_AUX5 BIT(0) +#define AD7280A_ALERT_REMOVE_AUX4_AUX5 BIT(1) struct ad7280_platform_data { unsigned acquisition_time; |