lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Mar 2021 20:14:43 +0800
From:   caizhichao <tomstomsczc@....com>
To:     perex@...ex.cz, tiwai@...e.com
Cc:     linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
        Zhichao Cai <caizhichao@...ong.com>
Subject: [PATCH] sound/i2c: Simplify the return expression of snd_i2c_bit_sendbyte()

From: Zhichao Cai <caizhichao@...ong.com>

Simplify the return expression.

Signed-off-by: Zhichao Cai <caizhichao@...ong.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ