Commit de81c3c3 authored by Roel Kluin's avatar Roel Kluin Committed by Mauro Carvalho Chehab

V4L/DVB (12199): remove redundant tests on unsigned

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ce27cd3b
...@@ -490,7 +490,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) ...@@ -490,7 +490,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input)
if (!av7110->analog_tuner_flags) if (!av7110->analog_tuner_flags)
return 0; return 0;
if (input < 0 || input >= 4) if (input >= 4)
return -EINVAL; return -EINVAL;
av7110->current_input = input; av7110->current_input = input;
......
...@@ -605,7 +605,7 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp) ...@@ -605,7 +605,7 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
if (ret) if (ret)
return ret; return ret;
if (inp < 0 || inp >= cx->nof_inputs) if (inp >= cx->nof_inputs)
return -EINVAL; return -EINVAL;
if (inp == cx->active_input) { if (inp == cx->active_input) {
......
...@@ -1790,7 +1790,7 @@ static int saa7134_s_input(struct file *file, void *priv, unsigned int i) ...@@ -1790,7 +1790,7 @@ static int saa7134_s_input(struct file *file, void *priv, unsigned int i)
if (0 != err) if (0 != err)
return err; return err;
if (i < 0 || i >= SAA7134_INPUT_MAX) if (i >= SAA7134_INPUT_MAX)
return -EINVAL; return -EINVAL;
if (NULL == card_in(dev, i).name) if (NULL == card_in(dev, i).name)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment