All of lore.kernel.org
 help / color / mirror / Atom feed
From: caizhichao <tomstomsczc@163.com>
To: perex@perex.cz, tiwai@suse.com
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	Zhichao Cai <caizhichao@yulong.com>
Subject: [PATCH] sound/i2c: Simplify the return expression of snd_i2c_bit_sendbyte()
Date: Tue, 23 Mar 2021 20:14:43 +0800	[thread overview]
Message-ID: <20210323121443.1276-1-tomstomsczc@163.com> (raw)

From: Zhichao Cai <caizhichao@yulong.com>

Simplify the return expression.

Signed-off-by: Zhichao Cai <caizhichao@yulong.com>
---
 sound/i2c/i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c
index 847e3b6..dfcc87e 100644
--- a/sound/i2c/i2c.c
+++ b/sound/i2c/i2c.c
@@ -235,9 +235,7 @@ static int snd_i2c_bit_sendbyte(struct snd_i2c_bus *bus, unsigned char data)
 	for (i = 7; i >= 0; i--)
 		snd_i2c_bit_send(bus, !!(data & (1 << i)));
 	err = snd_i2c_bit_ack(bus);
-	if (err < 0)
-		return err;
-	return 0;
+	return err < 0 ? err : 0;
 }
 
 static int snd_i2c_bit_readbyte(struct snd_i2c_bus *bus, int last)
-- 
1.9.1



WARNING: multiple messages have this Message-ID (diff)
From: caizhichao <tomstomsczc@163.com>
To: perex@perex.cz, tiwai@suse.com
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Zhichao Cai <caizhichao@yulong.com>
Subject: [PATCH] sound/i2c: Simplify the return expression of snd_i2c_bit_sendbyte()
Date: Tue, 23 Mar 2021 20:14:43 +0800	[thread overview]
Message-ID: <20210323121443.1276-1-tomstomsczc@163.com> (raw)

From: Zhichao Cai <caizhichao@yulong.com>

Simplify the return expression.

Signed-off-by: Zhichao Cai <caizhichao@yulong.com>
---
 sound/i2c/i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c
index 847e3b6..dfcc87e 100644
--- a/sound/i2c/i2c.c
+++ b/sound/i2c/i2c.c
@@ -235,9 +235,7 @@ static int snd_i2c_bit_sendbyte(struct snd_i2c_bus *bus, unsigned char data)
 	for (i = 7; i >= 0; i--)
 		snd_i2c_bit_send(bus, !!(data & (1 << i)));
 	err = snd_i2c_bit_ack(bus);
-	if (err < 0)
-		return err;
-	return 0;
+	return err < 0 ? err : 0;
 }
 
 static int snd_i2c_bit_readbyte(struct snd_i2c_bus *bus, int last)
-- 
1.9.1



             reply	other threads:[~2021-03-23 12:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 12:14 caizhichao [this message]
2021-03-23 12:14 ` [PATCH] sound/i2c: Simplify the return expression of snd_i2c_bit_sendbyte() caizhichao
2021-03-23 13:27 ` Johan Hovold
2021-03-23 13:27   ` Johan Hovold

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=20210323121443.1276-1-tomstomsczc@163.com \
    --to=tomstomsczc@163.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=caizhichao@yulong.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 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.