Skip to contentSkip to conversation

media: remove redundant tests on unsigned

PATCH New Roel Kluin 1 participant 1 message Jun 22, 2009 Media (V4L/DVB)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 media: remove redundant tests on unsigned

input, inp and i are unsigned. When negative they are wrapped and caught by the other test.

---

drivers/media/dvb/ttpci/av7110_v4l.c +1 -1
index ce64c62..8986d96 100644
@@ -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;
drivers/media/video/cx18/cx18-ioctl.c +1 -1
index d7b1921..fc76e4d 100644
@@ -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) {
drivers/media/video/saa7134/saa7134-video.c +1 -1
index e305c16..103096b 100644
@@ -1797,7 +1797,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;