diff mbox

Input: bcm5974.c initialize raw_w, raw_x and raw_y before it get used

Message ID 1252775770.3687.7.camel@ht.satnam (mailing list archive)
State Superseded
Headers show

Commit Message

Jaswinder Singh Rajput Sept. 12, 2009, 5:16 p.m. UTC
raw_w, raw_x and raw_y is used uninitialized for !raw_n

This also fixed these compilation warnings :

 CC [M]  drivers/input/mouse/bcm5974.o
drivers/input/mouse/bcm5974.c: In function ‘report_tp_state’:
drivers/input/mouse/bcm5974.c:319: warning: ‘raw_y’ may be used uninitialized in this function
drivers/input/mouse/bcm5974.c:319: warning: ‘raw_x’ may be used uninitialized in this function
drivers/input/mouse/bcm5974.c:319: warning: ‘raw_w’ may be used uninitialized in this function

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 drivers/input/mouse/bcm5974.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 2d8fc0b..171f345 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -345,7 +345,8 @@  static int report_tp_state(struct bcm5974 *dev, int size)
 		/* set the integrated button if applicable */
 		if (c->tp_type == TYPE2)
 			ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
-	}
+	} else
+		raw_w = raw_x = raw_y = 0;
 
 	/* while tracking finger still valid, count all fingers */
 	if (ptest > PRESSURE_LOW && origin) {