From: Andreas Klinger <ak@it-klinger.de>
To: Li Zhengyu <lizhengyu3@huawei.com>
Cc: jic23@kernel.org, lars@metafoo.de, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: srf08: Remove redundant if statement
Date: Wed, 25 May 2022 08:33:38 +0200 [thread overview]
Message-ID: <Yo3Nwnq58tjKp3nl@arbad> (raw)
In-Reply-To: <20220523122755.90638-1-lizhengyu3@huawei.com>
Acked-by: Andreas Klinger <ak@it-klinger.de>
Li Zhengyu <lizhengyu3@huawei.com> schrieb am Mo, 23. Mai 20:27:
> (!val) has been checked outside the loop, remove redundant (val &&)
> from loop.
>
> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.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
>
--
Andreas Klinger
Grabenreith 27
84508 Burgkirchen
+49 8623 919966
ak@it-klinger.de
www.it-klinger.de
www.grabenreith.de
next prev parent reply other threads:[~2022-05-25 6:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 12:27 [PATCH] iio: srf08: Remove redundant if statement Li Zhengyu
2022-05-25 6:33 ` Andreas Klinger [this message]
2022-05-28 17:14 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yo3Nwnq58tjKp3nl@arbad \
--to=ak@it-klinger.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhengyu3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox