summaryrefslogtreecommitdiffstats
path: root/drivers/iio/proximity
diff options
context:
space:
mode:
authorLi Zhengyu <lizhengyu3@huawei.com>2022-05-23 14:27:55 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-11 15:35:27 +0200
commit574e60b3d79fbf4bd13027750b4d5a75814cfc37 (patch)
treeb12152167d3a4beee0a2f6addc379a9233f4875b /drivers/iio/proximity
parentiio: dac: ti-dac5571: add support for ti,dac121c081 (diff)
downloadlinux-574e60b3d79fbf4bd13027750b4d5a75814cfc37.tar.xz
linux-574e60b3d79fbf4bd13027750b4d5a75814cfc37.zip
iio: srf08: Remove redundant if statement
(!val) has been checked outside the loop, remove redundant (val &&) from loop. Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com> Acked-by: Andreas Klinger <ak@it-klinger.de> Link: https://lore.kernel.org/r/20220523122755.90638-1-lizhengyu3@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/proximity')
-rw-r--r--drivers/iio/proximity/srf08.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c
index ac1ab7e89d4e..7ed11339c31e 100644
--- a/drivers/iio/proximity/srf08.c
+++ b/drivers/iio/proximity/srf08.c
@@ -354,7 +354,7 @@ static ssize_t srf08_write_sensitivity(struct srf08_data *data,
return -EINVAL;
for (i = 0; i < data->chip_info->num_sensitivity_avail; i++)
- if (val && (val == data->chip_info->sensitivity_avail[i])) {
+ if (val == data->chip_info->sensitivity_avail[i]) {
regval = i;
break;
}