All of lore.kernel.org
 help / color / mirror / Atom feed
From: simran singhal <singhalsimran0@gmail.com>
To: jic23@kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	outreachy-kernel@googlegroups.com
Subject: [PATCH 1/4] iio: common: st_sensors: Replace ternary operator with min macro
Date: Wed, 29 Mar 2017 18:03:08 +0530	[thread overview]
Message-ID: <1490790791-5694-2-git-send-email-singhalsimran0@gmail.com> (raw)
In-Reply-To: <1490790791-5694-1-git-send-email-singhalsimran0@gmail.com>

Use macro min() to get the minimum of two values for brevity and
readability.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 drivers/iio/common/st_sensors/st_sensors_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
index c83df4d..7a68fdd 100644
--- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
+++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
@@ -39,7 +39,7 @@ static int st_sensors_i2c_read_byte(struct st_sensor_transfer_buffer *tb,
 	*res_byte = err & 0xff;
 
 st_accel_i2c_read_byte_error:
-	return err < 0 ? err : 0;
+	return min(err, 0);
 }
 
 static int st_sensors_i2c_read_multiple_byte(
-- 
2.7.4


  reply	other threads:[~2017-03-29 12:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29 12:33 [PATCH 0/4] drivers: iio: Replace ternary operator with min macro simran singhal
2017-03-29 12:33 ` simran singhal [this message]
2017-03-29 16:16   ` [Outreachy kernel] [PATCH 1/4] iio: common: st_sensors: " Daniel Baluta
2017-03-29 17:24     ` SIMRAN SINGHAL
2017-03-29 12:33 ` [PATCH 2/4] iio: imu: st_lsm6dsx: " simran singhal
2017-03-29 12:33 ` [PATCH 3/4] " simran singhal
2017-03-29 12:33 ` [PATCH 4/4] iio: light: si1145: " simran singhal
2017-03-29 12:40   ` [Outreachy kernel] " Julia Lawall
2017-03-29 12:53     ` Lars-Peter Clausen
2017-03-29 14:52       ` SIMRAN SINGHAL
2017-03-29 14:53         ` SIMRAN SINGHAL
2017-03-29 18:56 ` [Outreachy kernel] [PATCH 0/4] drivers: iio: " Alison Schofield

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=1490790791-5694-2-git-send-email-singhalsimran0@gmail.com \
    --to=singhalsimran0@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pmeerw@pmeerw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.