]> git.baikalelectronics.ru Git - kernel.git/commit
[media] m920x: let GCC see 'ret' is used initialized
authorPaul Bolle <pebolle@tiscali.nl>
Mon, 4 Mar 2013 12:43:20 +0000 (09:43 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 18 Mar 2013 20:35:24 +0000 (17:35 -0300)
commit623635e460718dde60626b8dea608f4df368f8ae
tree13b82936910daeeac5b4f2c6e46fd6eed743e637
parentc9ce7cd2a6ea72ed08db32a53da4c207b1ddcdaa
[media] m920x: let GCC see 'ret' is used initialized

Since commit 9d1e65cc5bf8d6721e17743de1c86c6edec22000 ("[media] m920x:
factor out a m920x_write_seq() function") building m920x.o triggers this
GCC warning:
    drivers/media/usb/dvb-usb/m920x.c: In function ‘m920x_probe’:
    drivers/media/usb/dvb-usb/m920x.c:91:6: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]
This warning is caused by m920x_write_seq(), which is apparently inlined
into m920x_probe(). It is clear why GCC thinks 'ret' may be used
uninitialized. But in practice the first seq->address will always be
non-zero when this function is called. That means we can change the
while()-do{} loop into a do{}-while() loop. And that suffices to make
GCC see that 'ret' will not be used uninitialized.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/dvb-usb/m920x.c