From d084aa706761060940110279794e6a4e83785858 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Mon, 21 Aug 2006 10:36:36 -0300 Subject: V4L/DVB (4510): Fix signedness error in drivers/media/video/vivi.c when checking the -Wextra signedness warnings issued by gcc 4.1 I came across this one: drivers/media/video/vivi.c:1001: warning: comparison of unsigned expression < 0 is always false Since videobuf_reqbufs() returns negative values on errors the current code does no real error checking since gcc removes the comparison. This patch fixes this issue by making ret a normal, signed integer. Signed-off-by: Eric Sesterhenn Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/vivi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/vivi.c') diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 841884af0cc..06b44e1dda1 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c @@ -992,7 +992,8 @@ static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf) struct vivi_fh *fh=priv; struct videobuf_queue *q=&fh->vb_vidq; struct v4l2_requestbuffers req; - unsigned int i, ret; + unsigned int i; + int ret; req.type = q->type; req.count = 8; -- cgit v1.2.3 From d7fbefe06d2061de126095f903359ce1ef61faf3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 13 Sep 2006 13:26:03 -0300 Subject: V4L/DVB (4627): Vivi crashes with mplayer The vivi.current_norm field is not initialized in vivi.c, so a VIDIOC_G_STD ioctl without a prior call to VIDIOC_S_STD gives unpredictable results. mplayer does exactly this. Signed-off-by Sascha Hauer Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/vivi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/media/video/vivi.c') diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 06b44e1dda1..e7c01d560b6 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c @@ -1360,6 +1360,8 @@ static int __init vivi_init(void) dev->vidq.timeout.data = (unsigned long)dev; init_timer(&dev->vidq.timeout); + vivi.current_norm = tvnorms[0].id; + ret = video_register_device(&vivi, VFL_TYPE_GRABBER, video_nr); printk(KERN_INFO "Video Technology Magazine Virtual Video Capture Board (Load status: %d)\n", ret); return ret; -- cgit v1.2.3