Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (10127): stv06xx: Avoid having y unitialized

As pointed by gcc:

drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c: In function ‘hdcs_set_size’:
drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c:301: warning: ‘y’ may be used uninitialized in this function

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Erik Andrén and committed by
Mauro Carvalho Chehab
1970f14f de84830e

+4 -2
+4 -2
drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
··· 317 317 318 318 y = (hdcs->array.height - HDCS_1020_BOTTOM_Y_SKIP - height) / 2 319 319 + hdcs->array.top; 320 - } else if (height > hdcs->array.height) { 321 - height = hdcs->array.height; 320 + } else { 321 + if (height > hdcs->array.height) 322 + height = hdcs->array.height; 323 + 322 324 y = hdcs->array.top + (hdcs->array.height - height) / 2; 323 325 } 324 326