[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220523122755.90638-1-lizhengyu3@huawei.com>
Date: Mon, 23 May 2022 20:27:55 +0800
From: Li Zhengyu <lizhengyu3@...wei.com>
To: <ak@...klinger.de>
CC: <jic23@...nel.org>, <lars@...afoo.de>, <linux-iio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] iio: srf08: Remove redundant if statement
(!val) has been checked outside the loop, remove redundant (val &&)
from loop.
Signed-off-by: Li Zhengyu <lizhengyu3@...wei.com>
---
drivers/iio/proximity/srf08.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.17.1
Powered by blists - more mailing lists