]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Staging: iio: Remove parentheses around right side an assignment
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 13 Mar 2015 17:47:22 +0000 (20:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Mar 2015 15:10:08 +0000 (16:10 +0100)
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/accel/adis16240_core.c
drivers/staging/iio/light/tsl2x7x_core.c
drivers/staging/iio/meter/ade7753.c
drivers/staging/iio/meter/ade7754.c
drivers/staging/iio/meter/ade7759.c

index 3f46086eab3a30d86c464d2016255e7edb46f91c..e2f8affc4c15d420d7a324d2370f90c251a782cd 100644 (file)
@@ -46,7 +46,7 @@ static ssize_t adis16240_spi_read_signed(struct device *dev,
        if (val & ADIS16240_ERROR_ACTIVE)
                adis_check_status(st);
 
-       val = ((s16)(val << shift) >> shift);
+       val = (s16)(val << shift) >> shift;
        return sprintf(buf, "%d\n", val);
 }
 
index 52f4e65fcdf194bf43c00321002e94787e35d118..010e607dd8804fb1f74ef56fc8c3555cc66af22e 100644 (file)
@@ -613,8 +613,8 @@ static int tsl2x7x_als_calibrate(struct iio_dev *indio_dev)
                return lux_val;
        }
 
-       gain_trim_val =  (((chip->tsl2x7x_settings.als_cal_target)
-                       * chip->tsl2x7x_settings.als_gain_trim) / lux_val);
+       gain_trim_val =  ((chip->tsl2x7x_settings.als_cal_target)
+                       * chip->tsl2x7x_settings.als_gain_trim) / lux_val;
        if ((gain_trim_val < 250) || (gain_trim_val > 4000))
                return -ERANGE;
 
index 78e8f560eeec564aa19e94fb5e1f103b76236b4c..f828f5f3cb2c211c7fc97fd34f78999fdb231030 100644 (file)
@@ -411,7 +411,7 @@ static ssize_t ade7753_write_frequency(struct device *dev,
 
        mutex_lock(&indio_dev->mlock);
 
-       t = (27900 / val);
+       t = 27900 / val;
        if (t > 0)
                t--;
 
index 81f67318974ad77322c3f66138f25d3385463af9..e7171b532aa652e641b76dc60e4d6178974e3fc4 100644 (file)
@@ -432,7 +432,7 @@ static ssize_t ade7754_write_frequency(struct device *dev,
 
        mutex_lock(&indio_dev->mlock);
 
-       t = (26000 / val);
+       t = 26000 / val;
        if (t > 0)
                t--;
 
index 694e0ce1f2778a37479c7b57d6c219e141571031..2d5f038d3b30c96c490f25aa2c46273a0237d0a8 100644 (file)
@@ -371,7 +371,7 @@ static ssize_t ade7759_write_frequency(struct device *dev,
 
        mutex_lock(&indio_dev->mlock);
 
-       t = (27900 / val);
+       t = 27900 / val;
        if (t > 0)
                t--;