MLK-11917-2 media: output: pxp_v4l2: correct comparing unsigned to 0
authorFancy Fang <chen.fang@freescale.com>
Mon, 30 Nov 2015 02:32:37 +0000 (10:32 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:16 +0000 (14:49 -0500)
Comparing unsigned integer with 0 is meaningless. So
remove this kind of integer comparing.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
drivers/media/platform/mxc/output/mxc_pxp_v4l2.c

index 7d89d32..67d133a 100644 (file)
@@ -409,7 +409,7 @@ static int pxp_enumoutput(struct file *file, void *fh,
 {
        struct pxps *pxp = video_get_drvdata(video_devdata(file));
 
-       if ((o->index < 0) || (o->index > 1))
+       if (o->index > 1)
                return -EINVAL;
 
        memset(o, 0, sizeof(struct v4l2_output));
@@ -445,7 +445,7 @@ static int pxp_s_output(struct file *file, void *fh,
        u32 size;
        int ret, bpp;
 
-       if ((i < 0) || (i > 1))
+       if (i > 1)
                return -EINVAL;
 
        /* Output buffer is same format as fbdev */
@@ -480,9 +480,9 @@ static int pxp_enum_fmt_video_output(struct file *file, void *fh,
                                struct v4l2_fmtdesc *fmt)
 {
        enum v4l2_buf_type type = fmt->type;
-       int index = fmt->index;
+       unsigned int index = fmt->index;
 
-       if ((fmt->index < 0) || (fmt->index >= ARRAY_SIZE(pxp_s0_formats)))
+       if (fmt->index >= ARRAY_SIZE(pxp_s0_formats))
                return -EINVAL;
 
        memset(fmt, 0, sizeof(struct v4l2_fmtdesc));