Fix signedness error in drivers/media/video/vivi.c
PATCH 1/1 Fix signedness error in drivers/media/video/vivi.c
hi,
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.
drivers/media/video/vivi.c renamed from drivers/media/video/vivi.c.orig +2 -1
@@ -992,7 +992,8 @@ static int vidiocgmbuf (struct file *filstruct 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 ;
Ar Sad, 2006-08-19 am 18:19 +0200, ysgrifennodd Eric Sesterhenn:
Quoted 6 lines
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 <[email protected]>
Doesn't apply to latest driver tree but the problem is still present.
Alan
Em Dom, 2006-08-20 às 19:25 +0100, Alan Cox escreveu:
Quoted 9 lines
Ar Sad, 2006-08-19 am 18:19 +0200, ysgrifennodd Eric Sesterhenn:
Quoted 6 lines
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 <[email protected]>Doesn't apply to latest driver tree but the problem is still present.
Hmm... patch applied fine to v4l-dvb hg tree.
Quoted 3 lines
Alan
Cheers,
Mauro.