iio:light:cm3323: replace unneeded variable
authorHartmut Knaack <knaack.h@gmx.de>
Wed, 17 Jun 2015 22:32:03 +0000 (00:32 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 21 Jun 2015 13:27:38 +0000 (14:27 +0100)
In cm3323_read_raw() i is used as return variable for the integration time
index. The also existing return variable ret however is unused in this
case, although appropriate. Replace i with ret and drop it.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/cm3323.c

index 9c91363..af1b1b0 100644 (file)
@@ -155,7 +155,7 @@ static int cm3323_read_raw(struct iio_dev *indio_dev,
                           struct iio_chan_spec const *chan, int *val,
                           int *val2, long mask)
 {
-       int i, ret;
+       int ret;
        struct cm3323_data *data = iio_priv(indio_dev);
 
        switch (mask) {
@@ -172,14 +172,14 @@ static int cm3323_read_raw(struct iio_dev *indio_dev,
                return IIO_VAL_INT;
        case IIO_CHAN_INFO_INT_TIME:
                mutex_lock(&data->mutex);
-               i = cm3323_get_it_bits(data);
-               if (i < 0) {
+               ret = cm3323_get_it_bits(data);
+               if (ret < 0) {
                        mutex_unlock(&data->mutex);
-                       return i;
+                       return ret;
                }
 
-               *val = cm3323_int_time[i].val;
-               *val2 = cm3323_int_time[i].val2;
+               *val = cm3323_int_time[ret].val;
+               *val2 = cm3323_int_time[ret].val2;
                mutex_unlock(&data->mutex);
 
                return IIO_VAL_INT_PLUS_MICRO;