Patchwork bbc_i2c: Remove unneeded err variable

login
register
mail settings
Submitter Axel Lin
Date Nov. 22, 2011, 7:42 a.m.
Message ID <1321947740.2476.0.camel@phoenix>
Download mbox | patch
Permalink /patch/127009/
State Accepted
Delegated to: David Miller
Headers show

Comments

Axel Lin - Nov. 22, 2011, 7:42 a.m.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/sbus/char/bbc_i2c.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
David Miller - Dec. 4, 2011, 7 p.m.
From: Axel Lin <axel.lin@gmail.com>
Date: Tue, 22 Nov 2011 15:42:20 +0800

> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index 5f94d22..a0d1399 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -233,13 +233,9 @@  int bbc_i2c_write_buf(struct bbc_i2c_client *client,
 	int ret = 0;
 
 	while (len > 0) {
-		int err = bbc_i2c_writeb(client, *buf, off);
-
-		if (err < 0) {
-			ret = err;
+		ret = bbc_i2c_writeb(client, *buf, off);
+		if (ret < 0)
 			break;
-		}
-
 		len--;
 		buf++;
 		off++;
@@ -253,11 +249,9 @@  int bbc_i2c_read_buf(struct bbc_i2c_client *client,
 	int ret = 0;
 
 	while (len > 0) {
-		int err = bbc_i2c_readb(client, buf, off);
-		if (err < 0) {
-			ret = err;
+		ret = bbc_i2c_readb(client, buf, off);
+		if (ret < 0)
 			break;
-		}
 		len--;
 		buf++;
 		off++;