diff mbox

[53/68,media] tlg2300: index is unsigned, so never below zero

Message ID 1351370486-29040-54-git-send-email-mchehab@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Oct. 27, 2012, 8:41 p.m. UTC
drivers/media/usb/tlg2300/pd-video.c:891:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
drivers/media/usb/tlg2300/pd-video.c:926:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Cc: Huang Shijie <shijie8@gmail.com>
Cc: Kang Yong <kangyong@telegent.com>
Cc: Zhang Xiaobing <xbzhang@telegent.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/usb/tlg2300/pd-video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Huang Shijie Oct. 29, 2012, 2:14 a.m. UTC | #1
On Sun, Oct 28, 2012 at 4:41 AM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> drivers/media/usb/tlg2300/pd-video.c:891:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> drivers/media/usb/tlg2300/pd-video.c:926:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
>
> Cc: Huang Shijie <shijie8@gmail.com>
> Cc: Kang Yong <kangyong@telegent.com>
> Cc: Zhang Xiaobing <xbzhang@telegent.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> ---
>  drivers/media/usb/tlg2300/pd-video.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
> index 1f448ac..3082bfa 100644
> --- a/drivers/media/usb/tlg2300/pd-video.c
> +++ b/drivers/media/usb/tlg2300/pd-video.c
> @@ -888,7 +888,7 @@ static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *in)
>  {
>         struct front_face *front = fh;
>
> -       if (in->index < 0 || in->index >= POSEIDON_INPUTS)
> +       if (in->index >= POSEIDON_INPUTS)
>                 return -EINVAL;
>         strcpy(in->name, pd_inputs[in->index].name);
>         in->type  = V4L2_INPUT_TYPE_TUNER;
> @@ -923,7 +923,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int i)
>         struct poseidon *pd = front->pd;
>         s32 ret, cmd_status;
>
> -       if (i < 0 || i >= POSEIDON_INPUTS)
> +       if (i >= POSEIDON_INPUTS)
>                 return -EINVAL;
>         ret = send_set_req(pd, SGNL_SRC_SEL,
>                         pd_inputs[i].tlg_src, &cmd_status);
> --
> 1.7.11.7
>
thanks

Acked-by: Huang Shijie <shijie8@gmail.com>

Huang Shijie
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
index 1f448ac..3082bfa 100644
--- a/drivers/media/usb/tlg2300/pd-video.c
+++ b/drivers/media/usb/tlg2300/pd-video.c
@@ -888,7 +888,7 @@  static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *in)
 {
 	struct front_face *front = fh;
 
-	if (in->index < 0 || in->index >= POSEIDON_INPUTS)
+	if (in->index >= POSEIDON_INPUTS)
 		return -EINVAL;
 	strcpy(in->name, pd_inputs[in->index].name);
 	in->type  = V4L2_INPUT_TYPE_TUNER;
@@ -923,7 +923,7 @@  static int vidioc_s_input(struct file *file, void *fh, unsigned int i)
 	struct poseidon *pd = front->pd;
 	s32 ret, cmd_status;
 
-	if (i < 0 || i >= POSEIDON_INPUTS)
+	if (i >= POSEIDON_INPUTS)
 		return -EINVAL;
 	ret = send_set_req(pd, SGNL_SRC_SEL,
 			pd_inputs[i].tlg_src, &cmd_status);