MLK-20192-4: m2m: Coverity: remove the dead code
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Thu, 20 Dec 2018 02:48:17 +0000 (10:48 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Because the address of an object is never null and the if
statement will never true so remove the dead code

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
drivers/media/platform/imx8/mxc-isi-m2m.c

index 57d82ac..3de8e7a 100644 (file)
@@ -489,9 +489,6 @@ static int mxc_isi_m2m_enum_fmt_vid_out(struct file *file, void *priv,
                return -EINVAL;
 
        fmt = &mxc_isi_input_formats[f->index];
-       if (!fmt)
-               return -EINVAL;
-
        strncpy(f->description, fmt->name, sizeof(f->description) - 1);
 
        f->pixelformat = fmt->fourcc;
@@ -510,9 +507,6 @@ static int mxc_isi_m2m_enum_fmt_vid_cap(struct file *file, void *priv,
                return -EINVAL;
 
        fmt = &mxc_isi_out_formats[f->index];
-       if (!fmt)
-               return -EINVAL;
-
        strncpy(f->description, fmt->name, sizeof(f->description) - 1);
 
        f->pixelformat = fmt->fourcc;