Thread (60 messages) flat view 60 messages, 12 authors, 2012-11-14
STALE5036d

Revision v2 of 7 in this series.

Revisions (7)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v2 [diff vs current]
  5. v2 [diff vs current]
  6. v2 [diff vs current]
  7. v2 current

[PATCH v2 2/7] i2c: omap: reorder exit path of omap_i2c_xfer_msg()

From: Lothar Waßmann <hidden>
Date: 2012-10-25 12:53:33
Also in: linux-i2c, linux-omap

Hi,

Santosh Shilimkar writes:
On Thursday 25 October 2012 05:55 PM, Felipe Balbi wrote:
quoted
just a cleanup patch trying to make exit path
more straightforward. No changes otherwise.

Signed-off-by: Felipe Balbi <redacted>
---
  drivers/i2c/busses/i2c-omap.c | 26 +++++++++++++++++---------
  1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index c07d9c4..bea0277 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -505,6 +505,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
  {
  	struct omap_i2c_dev *dev = i2c_get_adapdata(adap);
  	unsigned long timeout;
+	int ret;
[...]
quoted
+		ret = -EREMOTEIO;
+		goto err;
  	}
-	return -EIO;
+
+	return 0;
With initialized value you can use
return ret;
Doing it this way has the advantage, that if an additional error exit
is added it will generate an 'uninitialized variable' warning, if it
fails to set the return value.



Lothar Wa?mann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help