staging: iio: meter: replace ternary operator by if condition
authorDeepak R Varma <drv@mailo.com>
Sun, 13 Nov 2022 05:28:20 +0000 (10:58 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 23 Nov 2022 19:58:45 +0000 (19:58 +0000)
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>
Link: https://lore.kernel.org/r/Y3CAdCa17WdWDYUa@qemulion
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/meter/ade7854-i2c.c

index a9a06e8dda51f0d2c00dbf999696dc4f3c75217b..71b67dd3c8e98f4cba3dafcca6ad89fc785f21df 100644 (file)
@@ -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,