From: Jonathan Cameron <jic23@kernel.org>
To: Andreas Klinger <ak@it-klinger.de>
Cc: Li Zhengyu <lizhengyu3@huawei.com>,
lars@metafoo.de, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: srf08: Remove redundant if statement
Date: Sat, 28 May 2022 18:14:03 +0100 [thread overview]
Message-ID: <20220528181403.16c0971d@jic23-huawei> (raw)
In-Reply-To: <Yo3Nwnq58tjKp3nl@arbad>
On Wed, 25 May 2022 08:33:38 +0200
Andreas Klinger <ak@it-klinger.de> wrote:
> 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>
Hi Li Zhengyu,
Applied to the togreg branch of iio.git which is initially pushed out as testing
or 0-day to see if we missed anything.
I'll push it out for linux-next to pick up once the merge window closes.
Thanks,
Jonathan
> > ---
> > 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
> >
>
prev parent reply other threads:[~2022-05-28 17:06 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
2022-05-28 17:14 ` Jonathan Cameron [this message]
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=20220528181403.16c0971d@jic23-huawei \
--to=jic23@kernel.org \
--cc=ak@it-klinger.de \
--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