diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-10-23 06:59:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:04 -0500 |
commit | f14a2972e40dbfbe7077ec7ab21cc2729f7e7d6d (patch) | |
tree | a90af6ec74660e5a811d40e7af45578c1b1e104f /drivers/media | |
parent | 311c70e1f906b7411b30f526ef15deb62cb37e7a (diff) |
V4L/DVB (13241): Cleanup redundant tests on unsigned
The variables are unsigned so the test `>= 0' is always true,
the `< 0' test always fails. In these cases the other part of
the test catches wrapped values.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/common/tuners/tda9887.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smscoreapi.c | 2 | ||||
-rw-r--r-- | drivers/media/video/bt819.c | 2 | ||||
-rw-r--r-- | drivers/media/video/hexium_gemini.c | 2 | ||||
-rw-r--r-- | drivers/media/video/hexium_orion.c | 2 | ||||
-rw-r--r-- | drivers/media/video/mxb.c | 2 | ||||
-rw-r--r-- | drivers/media/video/s2255drv.c | 2 | ||||
-rw-r--r-- | drivers/media/video/saa7110.c | 2 | ||||
-rw-r--r-- | drivers/media/video/saa717x.c | 2 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 2 | ||||
-rw-r--r-- | drivers/media/video/vpx3220.c | 2 | ||||
-rw-r--r-- | drivers/media/video/zoran/zoran_driver.c | 2 |
13 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/common/tuners/tda9887.c b/drivers/media/common/tuners/tda9887.c index 544cdbe88a6..a71c100c95d 100644 --- a/drivers/media/common/tuners/tda9887.c +++ b/drivers/media/common/tuners/tda9887.c | |||
@@ -463,7 +463,7 @@ static int tda9887_set_insmod(struct dvb_frontend *fe) | |||
463 | buf[1] &= ~cQSS; | 463 | buf[1] &= ~cQSS; |
464 | } | 464 | } |
465 | 465 | ||
466 | if (adjust >= 0x00 && adjust < 0x20) { | 466 | if (adjust < 0x20) { |
467 | buf[2] &= ~cTopMask; | 467 | buf[2] &= ~cTopMask; |
468 | buf[2] |= adjust; | 468 | buf[2] |= adjust; |
469 | } | 469 | } |
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index fa6a62369a7..ca758bcb48c 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c | |||
@@ -1373,7 +1373,7 @@ static int GetGpioPinParams(u32 PinNum, u32 *pTranslatedPinNum, | |||
1373 | 1373 | ||
1374 | *pGroupCfg = 1; | 1374 | *pGroupCfg = 1; |
1375 | 1375 | ||
1376 | if (PinNum >= 0 && PinNum <= 1) { | 1376 | if (PinNum <= 1) { |
1377 | *pTranslatedPinNum = 0; | 1377 | *pTranslatedPinNum = 0; |
1378 | *pGroupNum = 9; | 1378 | *pGroupNum = 9; |
1379 | *pGroupCfg = 2; | 1379 | *pGroupCfg = 2; |
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index f9330e3529c..5bb0f9e7158 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c | |||
@@ -299,7 +299,7 @@ static int bt819_s_routing(struct v4l2_subdev *sd, | |||
299 | 299 | ||
300 | v4l2_dbg(1, debug, sd, "set input %x\n", input); | 300 | v4l2_dbg(1, debug, sd, "set input %x\n", input); |
301 | 301 | ||
302 | if (input < 0 || input > 7) | 302 | if (input > 7) |
303 | return -EINVAL; | 303 | return -EINVAL; |
304 | 304 | ||
305 | if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) | 305 | if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) |
diff --git a/drivers/media/video/hexium_gemini.c b/drivers/media/video/hexium_gemini.c index 71c211402eb..60d992ee258 100644 --- a/drivers/media/video/hexium_gemini.c +++ b/drivers/media/video/hexium_gemini.c | |||
@@ -251,7 +251,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) | |||
251 | 251 | ||
252 | DEB_EE(("VIDIOC_S_INPUT %d.\n", input)); | 252 | DEB_EE(("VIDIOC_S_INPUT %d.\n", input)); |
253 | 253 | ||
254 | if (input < 0 || input >= HEXIUM_INPUTS) | 254 | if (input >= HEXIUM_INPUTS) |
255 | return -EINVAL; | 255 | return -EINVAL; |
256 | 256 | ||
257 | hexium->cur_input = input; | 257 | hexium->cur_input = input; |
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c index 39d65ca41c6..938a1f8f880 100644 --- a/drivers/media/video/hexium_orion.c +++ b/drivers/media/video/hexium_orion.c | |||
@@ -350,7 +350,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) | |||
350 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; | 350 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
351 | struct hexium *hexium = (struct hexium *) dev->ext_priv; | 351 | struct hexium *hexium = (struct hexium *) dev->ext_priv; |
352 | 352 | ||
353 | if (input < 0 || input >= HEXIUM_INPUTS) | 353 | if (input >= HEXIUM_INPUTS) |
354 | return -EINVAL; | 354 | return -EINVAL; |
355 | 355 | ||
356 | hexium->cur_input = input; | 356 | hexium->cur_input = input; |
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 3454070e63f..c1fc6dc776f 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
@@ -478,7 +478,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) | |||
478 | 478 | ||
479 | DEB_EE(("VIDIOC_S_INPUT %d.\n", input)); | 479 | DEB_EE(("VIDIOC_S_INPUT %d.\n", input)); |
480 | 480 | ||
481 | if (input < 0 || input >= MXB_INPUTS) | 481 | if (input >= MXB_INPUTS) |
482 | return -EINVAL; | 482 | return -EINVAL; |
483 | 483 | ||
484 | mxb->cur_input = input; | 484 | mxb->cur_input = input; |
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index 2c0bb06cab3..d0824f3c734 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c | |||
@@ -1958,7 +1958,7 @@ static int save_frame(struct s2255_dev *dev, struct s2255_pipeinfo *pipe_info) | |||
1958 | if (pdword[1] >= MAX_CHANNELS) | 1958 | if (pdword[1] >= MAX_CHANNELS) |
1959 | break; | 1959 | break; |
1960 | cc = G_chnmap[pdword[1]]; | 1960 | cc = G_chnmap[pdword[1]]; |
1961 | if (!(cc >= 0 && cc < MAX_CHANNELS)) | 1961 | if (cc >= MAX_CHANNELS) |
1962 | break; | 1962 | break; |
1963 | switch (pdword[2]) { | 1963 | switch (pdword[2]) { |
1964 | case S2255_RESPONSE_SETMODE: | 1964 | case S2255_RESPONSE_SETMODE: |
diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index 5c24c993ac1..3bca744e43a 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c | |||
@@ -304,7 +304,7 @@ static int saa7110_s_routing(struct v4l2_subdev *sd, | |||
304 | { | 304 | { |
305 | struct saa7110 *decoder = to_saa7110(sd); | 305 | struct saa7110 *decoder = to_saa7110(sd); |
306 | 306 | ||
307 | if (input < 0 || input >= SAA7110_MAX_INPUT) { | 307 | if (input >= SAA7110_MAX_INPUT) { |
308 | v4l2_dbg(1, debug, sd, "input=%d not available\n", input); | 308 | v4l2_dbg(1, debug, sd, "input=%d not available\n", input); |
309 | return -EINVAL; | 309 | return -EINVAL; |
310 | } | 310 | } |
diff --git a/drivers/media/video/saa717x.c b/drivers/media/video/saa717x.c index b15c40908e8..ad6cd37311f 100644 --- a/drivers/media/video/saa717x.c +++ b/drivers/media/video/saa717x.c | |||
@@ -1115,7 +1115,7 @@ static int saa717x_s_video_routing(struct v4l2_subdev *sd, | |||
1115 | v4l2_dbg(1, debug, sd, "decoder set input (%d)\n", input); | 1115 | v4l2_dbg(1, debug, sd, "decoder set input (%d)\n", input); |
1116 | /* inputs from 0-9 are available*/ | 1116 | /* inputs from 0-9 are available*/ |
1117 | /* saa717x have mode0-mode9 but mode5 is reserved. */ | 1117 | /* saa717x have mode0-mode9 but mode5 is reserved. */ |
1118 | if (input < 0 || input > 9 || input == 5) | 1118 | if (input > 9 || input == 5) |
1119 | return -EINVAL; | 1119 | return -EINVAL; |
1120 | 1120 | ||
1121 | if (decoder->input != input) { | 1121 | if (decoder->input != input) { |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 50f6db5cd50..a9c9703113c 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -328,7 +328,7 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
328 | 328 | ||
329 | t->type = type; | 329 | t->type = type; |
330 | /* prevent invalid config values */ | 330 | /* prevent invalid config values */ |
331 | t->config = ((new_config >= 0) && (new_config < 256)) ? new_config : 0; | 331 | t->config = new_config < 256 ? new_config : 0; |
332 | if (tuner_callback != NULL) { | 332 | if (tuner_callback != NULL) { |
333 | tuner_dbg("defining GPIO callback\n"); | 333 | tuner_dbg("defining GPIO callback\n"); |
334 | t->fe.callback = tuner_callback; | 334 | t->fe.callback = tuner_callback; |
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index a2a50d608a3..c07b0ac452a 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -601,7 +601,7 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int input) | |||
601 | { | 601 | { |
602 | struct usb_usbvision *usbvision = video_drvdata(file); | 602 | struct usb_usbvision *usbvision = video_drvdata(file); |
603 | 603 | ||
604 | if ((input >= usbvision->video_inputs) || (input < 0) ) | 604 | if (input >= usbvision->video_inputs) |
605 | return -EINVAL; | 605 | return -EINVAL; |
606 | 606 | ||
607 | mutex_lock(&usbvision->lock); | 607 | mutex_lock(&usbvision->lock); |
diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c index 97e0ce28ff1..33205d7537d 100644 --- a/drivers/media/video/vpx3220.c +++ b/drivers/media/video/vpx3220.c | |||
@@ -391,7 +391,7 @@ static int vpx3220_s_routing(struct v4l2_subdev *sd, | |||
391 | {0x0e, 1} | 391 | {0x0e, 1} |
392 | }; | 392 | }; |
393 | 393 | ||
394 | if (input < 0 || input > 2) | 394 | if (input > 2) |
395 | return -EINVAL; | 395 | return -EINVAL; |
396 | 396 | ||
397 | v4l2_dbg(1, debug, sd, "input switched to %s\n", inputs[input]); | 397 | v4l2_dbg(1, debug, sd, "input switched to %s\n", inputs[input]); |
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index 47137deafcf..e9f72ca458f 100644 --- a/drivers/media/video/zoran/zoran_driver.c +++ b/drivers/media/video/zoran/zoran_driver.c | |||
@@ -2764,7 +2764,7 @@ static int zoran_enum_input(struct file *file, void *__fh, | |||
2764 | struct zoran_fh *fh = __fh; | 2764 | struct zoran_fh *fh = __fh; |
2765 | struct zoran *zr = fh->zr; | 2765 | struct zoran *zr = fh->zr; |
2766 | 2766 | ||
2767 | if (inp->index < 0 || inp->index >= zr->card.inputs) | 2767 | if (inp->index >= zr->card.inputs) |
2768 | return -EINVAL; | 2768 | return -EINVAL; |
2769 | else { | 2769 | else { |
2770 | int id = inp->index; | 2770 | int id = inp->index; |