Thread (4 messages) 4 messages, 3 authors, 2009-12-15

Re: [PATCH][input] add Honeywell hmc5843 3-Axis Magnetometer (digital compass) driver.

From: Dan Carpenter <hidden>
Date: 2009-12-15 14:23:05
Also in: lkml

On Thu, Dec 10, 2009 at 10:50:12PM -0800, Steven King wrote:
+static void hmc5843_poll(struct input_polled_dev *ipdev)
+{
+	struct hmc5843 *hmc5843 = ipdev->private;
+	int x, y, z;
+
  CC      drivers/input/misc/hmc5843.o
drivers/input/misc/hmc5843.c: In function ‘hmc5843_poll’:
drivers/input/misc/hmc5843.c:312: warning: ‘x’ may be used uninitialized in this function
drivers/input/misc/hmc5843.c:312: warning: ‘y’ may be used uninitialized in this function
drivers/input/misc/hmc5843.c:312: warning: ‘z’ may be used uninitialized in this function

+	mutex_lock(&hmc5843->lock);
+	if (!hmc5843_read_xyz(hmc5843, &x, &y, &z)) {
+		input_report_abs(ipdev->input, ABS_X, x);
+		input_report_abs(ipdev->input, ABS_Y, y);
+		input_report_abs(ipdev->input, ABS_Z, z);
+		input_sync(ipdev->input);
+	}
+	mutex_unlock(&hmc5843->lock);
+}
+
Some versions of gcc may not complain, but could you suppress
the warnings anyway?

regards,
dan carpenter
--
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help