Commit 574e60b3 authored by Li Zhengyu's avatar Li Zhengyu Committed by Jonathan Cameron

iio: srf08: Remove redundant if statement

(!val) has been checked outside the loop, remove redundant (val &&)
from loop.
Signed-off-by: default avatarLi Zhengyu <lizhengyu3@huawei.com>
Acked-by: default avatarAndreas Klinger <ak@it-klinger.de>
Link: https://lore.kernel.org/r/20220523122755.90638-1-lizhengyu3@huawei.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a5daaa47
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment