linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: bcm5974.c initialize raw_w, raw_x and raw_y before it get used
@ 2009-09-12 17:16 Jaswinder Singh Rajput
  2009-09-12 23:24 ` Henrik Rydberg
  0 siblings, 1 reply; 7+ messages in thread
From: Jaswinder Singh Rajput @ 2009-09-12 17:16 UTC (permalink / raw)
  To: Henrik Rydberg, Dmitry Torokhov, linux-input


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 --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) {
-- 
1.6.4.2


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-15 11:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-12 17:16 [PATCH] Input: bcm5974.c initialize raw_w, raw_x and raw_y before it get used Jaswinder Singh Rajput
2009-09-12 23:24 ` Henrik Rydberg
2009-09-13  8:31   ` Jaswinder Singh Rajput
2009-09-13 11:39     ` Henrik Rydberg
2009-09-14  4:37       ` Dmitry Torokhov
2009-09-14  9:00       ` Jaswinder Singh Rajput
2009-09-15 11:23         ` Henrik Rydberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).