V4L/DVB (12199): remove redundant tests on unsigned
authorRoel Kluin <roel.kluin@gmail.com>
Thu, 2 Jul 2009 19:09:25 +0000 (16:09 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 12 Sep 2009 15:17:23 +0000 (12:17 -0300)
input, inp and i are unsigned. When negative they are wrapped and caught by the
other test.

Cc: Andy Walls <awalls@radix.net>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/ttpci/av7110_v4l.c
drivers/media/video/cx18/cx18-ioctl.c
drivers/media/video/saa7134/saa7134-video.c

index ce64c6214cc410d473e61eac226ffa3514acea19..8986d967d2f4bb03c0e67dae2458a686e718ad3e 100644 (file)
@@ -490,7 +490,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input)
        if (!av7110->analog_tuner_flags)
                return 0;
 
-       if (input < 0 || input >= 4)
+       if (input >= 4)
                return -EINVAL;
 
        av7110->current_input = input;
index d7b1921e6666006f327c54b3e18ce8b3ac649886..fc76e4d6ffa72d3d6c48e9bc169d2465a5f03a25 100644 (file)
@@ -605,7 +605,7 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
        if (ret)
                return ret;
 
-       if (inp < 0 || inp >= cx->nof_inputs)
+       if (inp >= cx->nof_inputs)
                return -EINVAL;
 
        if (inp == cx->active_input) {
index ba87128542e03254aa27e5ab3f55dbcca869cffa..bf4c99d191508b5612ff6dc813a3b29f64a749ec 100644 (file)
@@ -1790,7 +1790,7 @@ static int saa7134_s_input(struct file *file, void *priv, unsigned int i)
        if (0 != err)
                return err;
 
-       if (i < 0  ||  i >= SAA7134_INPUT_MAX)
+       if (i >= SAA7134_INPUT_MAX)
                return -EINVAL;
        if (NULL == card_in(dev, i).name)
                return -EINVAL;