lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][input] add Honeywell hmc5843 3-Axis Magnetometer (digital compass) driver.
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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-12-15 15:25    [W:2.109 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site