[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1490790791-5694-3-git-send-email-singhalsimran0@gmail.com>
Date: Wed, 29 Mar 2017 18:03:09 +0530
From: simran singhal <singhalsimran0@...il.com>
To: jic23@...nel.org
Cc: knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
outreachy-kernel@...glegroups.com
Subject: [PATCH 2/4] iio: imu: st_lsm6dsx: Replace ternary operator with min macro
Use macro min() to get the minimum of two values for brevity and
readability.
Signed-off-by: simran singhal <singhalsimran0@...il.com>
---
drivers/iio/humidity/hts221_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c
index 3f3ef4a1..f98240a 100644
--- a/drivers/iio/humidity/hts221_core.c
+++ b/drivers/iio/humidity/hts221_core.c
@@ -206,7 +206,7 @@ int hts221_config_drdy(struct hts221_hw *hw, bool enable)
err = hts221_write_with_mask(hw, HTS221_REG_CNTRL3_ADDR,
HTS221_DRDY_MASK, val);
- return err < 0 ? err : 0;
+ return min(err, 0);
}
static int hts221_update_odr(struct hts221_hw *hw, u8 odr)
--
2.7.4
Powered by blists - more mailing lists