From 1970f14fde9640cc2e238c031498900edbd8ff94 Mon Sep 17 00:00:00 2001 From: Erik Andrén Date: Tue, 30 Dec 2008 04:58:36 -0300 Subject: V4L/DVB (10127): stv06xx: Avoid having y unitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c') diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c index 1cfe58504553..14335a9e4bb5 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c +++ b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c @@ -317,8 +317,10 @@ static int hdcs_set_size(struct sd *sd, y = (hdcs->array.height - HDCS_1020_BOTTOM_Y_SKIP - height) / 2 + hdcs->array.top; - } else if (height > hdcs->array.height) { - height = hdcs->array.height; + } else { + if (height > hdcs->array.height) + height = hdcs->array.height; + y = hdcs->array.top + (hdcs->array.height - height) / 2; } -- cgit v1.2.3-59-g8ed1b