[media] gspca: warning fix: index is unsigned, so it will never be below 0
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 27 Oct 2012 17:55:20 +0000 (14:55 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 28 Oct 2012 09:38:36 +0000 (07:38 -0200)
drivers/media/usb/gspca/gspca.c: In function 'vidioc_querybuf':
drivers/media/usb/gspca/gspca.c:1590:6: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/gspca/gspca.c

index a2b934146ebf9245da1a972b36addc89eb7b026c..e0a431bb0d4207aa5b7910b9b483af31d9d381e1 100644 (file)
@@ -1586,8 +1586,7 @@ static int vidioc_querybuf(struct file *file, void *priv,
        struct gspca_dev *gspca_dev = video_drvdata(file);
        struct gspca_frame *frame;
 
-       if (v4l2_buf->index < 0
-           || v4l2_buf->index >= gspca_dev->nframes)
+       if (v4l2_buf->index >= gspca_dev->nframes)
                return -EINVAL;
 
        frame = &gspca_dev->frame[v4l2_buf->index];