From: Jonathan Cameron <jic23@kernel.org>
To: Deepak R Varma <drv@mailo.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: iio: meter: replace ternary operator by if condition
Date: Sun, 13 Nov 2022 13:03:06 +0000 [thread overview]
Message-ID: <20221113130306.517e7aa3@jic23-huawei> (raw)
In-Reply-To: <Y3CAdCa17WdWDYUa@qemulion>
On Sun, 13 Nov 2022 10:58:20 +0530
Deepak R Varma <drv@mailo.com> wrote:
> Replace ternary operator by simple if based evaluation of the return
> value. Issue identified using coccicheck.
>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
Applied to the togreg branch of iio.git and pushed out as testing to
see if 0-day can find anything we missed.
Thanks,
Jonathan
> ---
>
> Changes in v2:
> 1. Use if based evaluation instead of using min macro
> suggested by Joe Perches.
>
>
> drivers/staging/iio/meter/ade7854-i2c.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter/ade7854-i2c.c
> index a9a06e8dda51..71b67dd3c8e9 100644
> --- a/drivers/staging/iio/meter/ade7854-i2c.c
> +++ b/drivers/staging/iio/meter/ade7854-i2c.c
> @@ -61,7 +61,10 @@ static int ade7854_i2c_write_reg(struct device *dev,
> unlock:
> mutex_unlock(&st->buf_lock);
>
> - return ret < 0 ? ret : 0;
> + if (ret < 0)
> + return ret;
> +
> + return 0;
> }
>
> static int ade7854_i2c_read_reg(struct device *dev,
> --
> 2.34.1
>
>
>
prev parent reply other threads:[~2022-11-13 12:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 5:28 [PATCH v2] staging: iio: meter: replace ternary operator by if condition Deepak R Varma
2022-11-13 13:03 ` 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=20221113130306.517e7aa3@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=drv@mailo.com \
--cc=gregkh@linuxfoundation.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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