diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-16 23:44:31 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 14:43:48 -0800 |
commit | 0fd736f9f4d2aea8dd63bd3e622da8a955e11c82 (patch) | |
tree | aafb28ece04cb19c19a58d24267129002dbee804 /drivers/staging/iio/adc | |
parent | 6a707a9eb9de373ba3ed2f85d44dce8bda229afc (diff) | |
download | linux-stable-0fd736f9f4d2aea8dd63bd3e622da8a955e11c82.tar.gz linux-stable-0fd736f9f4d2aea8dd63bd3e622da8a955e11c82.tar.bz2 linux-stable-0fd736f9f4d2aea8dd63bd3e622da8a955e11c82.zip |
staging: iio: adc: Remove unnecessary test from if conditions
Remove unnecessary test condition on ret variable which has been
previously tested and returns its value if the value is non zero.
This fixes the following smatch warnings:
drivers/staging/iio/adc/ad7816.c:299 ad7816_set_oti() warn: we tested
'ret' before and it was 'false'
drivers/staging/iio/adc/ad7816.c:306 ad7816_set_oti() warn: we tested
'ret' before and it was 'false'
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/adc')
-rw-r--r-- | drivers/staging/iio/adc/ad7816.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index 22260512cf01..ac3735c7f4a9 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -296,14 +296,14 @@ static inline ssize_t ad7816_set_oti(struct device *dev, dev_err(dev, "Invalid oti channel id %d.\n", chip->channel_id); return -EINVAL; } else if (chip->channel_id == 0) { - if (ret || value < AD7816_BOUND_VALUE_MIN || + if (value < AD7816_BOUND_VALUE_MIN || value > AD7816_BOUND_VALUE_MAX) return -EINVAL; data = (u8)(value - AD7816_BOUND_VALUE_MIN + AD7816_BOUND_VALUE_BASE); } else { - if (ret || value < AD7816_BOUND_VALUE_BASE || value > 255) + if (value < AD7816_BOUND_VALUE_BASE || value > 255) return -EINVAL; data = (u8)value; |