linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Puranjay Mohan <puranjay12@gmail.com>
Cc: Michael.Hennerich@analog.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, lars@metafoo.de,
	Dragos.Bogdan@analog.com, Darius.Berghe@analog.com,
	andy.shevchenko@gmail.com
Subject: Re: [PATCH v2 1/2] iio: accel: adxl355: use if(ret) in place of ret < 0
Date: Sun, 5 Sep 2021 17:13:28 +0100	[thread overview]
Message-ID: <20210905171328.2cf393ff@jic23-huawei> (raw)
In-Reply-To: <20210903184312.21009-2-puranjay12@gmail.com>

On Sat,  4 Sep 2021 00:13:11 +0530
Puranjay Mohan <puranjay12@gmail.com> wrote:

> Replace if(ret < 0) with if(ret) for consistency.
> 
> Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
There are several other cases where it would be good to clean this up.

Just cleaning one of them up leaves it inconsistent.
From a quick look I'm fairly sure all the if (ret < 0) can become if (ret)
with no functional change.

Thanks,

Jonathan


> ---
>  drivers/iio/accel/adxl355_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c
> index c91d2254c..0b9996c17 100644
> --- a/drivers/iio/accel/adxl355_core.c
> +++ b/drivers/iio/accel/adxl355_core.c
> @@ -570,7 +570,7 @@ int adxl355_core_probe(struct device *dev, struct regmap *regmap,
>  	indio_dev->num_channels = ARRAY_SIZE(adxl355_channels);
>  
>  	ret = adxl355_setup(data);
> -	if (ret < 0) {
> +	if (ret) {
>  		dev_err(dev, "ADXL355 setup failed\n");
>  		return ret;
>  	}


  reply	other threads:[~2021-09-05 16:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 18:43 [PATCH v2 0/2] adxl355: Add triggered buffer support Puranjay Mohan
2021-09-03 18:43 ` [PATCH v2 1/2] iio: accel: adxl355: use if(ret) in place of ret < 0 Puranjay Mohan
2021-09-05 16:13   ` Jonathan Cameron [this message]
2021-09-03 18:43 ` [PATCH v2 2/2] iio: accel: adxl355: Add triggered buffer support Puranjay Mohan
2021-09-05 16:29   ` 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=20210905171328.2cf393ff@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Darius.Berghe@analog.com \
    --cc=Dragos.Bogdan@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=puranjay12@gmail.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;
as well as URLs for NNTP newsgroup(s).