Thread (12 messages) 12 messages, 7 authors, 2011-12-02
STALE5336d

[PATCH] i2c-mxs: fix compile warning in mxs_i2c_xfer()

From: Shawn Guo <hidden>
Date: 2011-11-24 07:52:20
Also in: linux-i2c
Subsystem: i2c subsystem, i2c subsystem host drivers, the rest · Maintainers: Andi Shyti, Linus Torvalds

  CC      drivers/i2c/busses/i2c-mxs.o
drivers/i2c/busses/i2c-mxs.c: In function ?mxs_i2c_xfer?:
drivers/i2c/busses/i2c-mxs.c:196:6: warning: ?data? may be used uninitialized in this function

Signed-off-by: Shawn Guo <redacted>
---
 drivers/i2c/busses/i2c-mxs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 7e78f7c..00f098f 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -193,7 +193,7 @@ static int mxs_i2c_wait_for_data(struct mxs_i2c_dev *i2c)
 
 static int mxs_i2c_finish_read(struct mxs_i2c_dev *i2c, u8 *buf, int len)
 {
-	u32 data;
+	u32 data = 0;
 	int i;
 
 	for (i = 0; i < len; i++) {
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help