HID: Fix uninitialized variable "size" in hid-wiimote-debug

This variable is initialized conditionally, based on whether a wiimote
call succeeds.  However, the logic is not obvious to the compiler so it
throws a warning.  Eliminate the warning by initializing "size" to 0.

The warning is:
files/drivers/hid/hid-wiimote-debug.c:69:18: warning: 'size' may be used
uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Simon Que <sque@chromium.org>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Simon Que 2013-01-17 13:02:52 -08:00 коммит произвёл Jiri Kosina
Родитель aaca9cc016
Коммит b77a989acc
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -31,7 +31,7 @@ static ssize_t wiidebug_eeprom_read(struct file *f, char __user *u, size_t s,
unsigned long flags; unsigned long flags;
ssize_t ret; ssize_t ret;
char buf[16]; char buf[16];
__u16 size; __u16 size = 0;
if (s == 0) if (s == 0)
return -EINVAL; return -EINVAL;