diff mbox series

[v2,1/2] iio: accel: adxl355: use if(ret) in place of ret < 0

Message ID 20210903184312.21009-2-puranjay12@gmail.com (mailing list archive)
State Accepted
Headers show
Series adxl355: Add triggered buffer support | expand

Commit Message

Puranjay Mohan Sept. 3, 2021, 6:43 p.m. UTC
Replace if(ret < 0) with if(ret) for consistency.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
---
 drivers/iio/accel/adxl355_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron Sept. 5, 2021, 4:13 p.m. UTC | #1
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;
>  	}
diff mbox series

Patch

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;
 	}