Commit d2d476b7 authored by Christopher Díaz Riveros's avatar Christopher Díaz Riveros Committed by Mauro Carvalho Chehab

media: s2255drv: Remove unneeded if else blocks

Given the following definitions from s2255drv.c

 #define LINE_SZ_4CIFS_NTSC      640
 #define LINE_SZ_2CIFS_NTSC      640
 #define LINE_SZ_1CIFS_NTSC      320

and

 #define LINE_SZ_4CIFS_PAL       704
 #define LINE_SZ_2CIFS_PAL       704
 #define LINE_SZ_1CIFS_PAL       352

f->fmt.pix.width possible values can be reduced to
LINE_SZ_4CIFS_NTSC or LINE_SZ_1CIFS_NTSC.

This patch removes unneeded if else blocks in vidioc_try_fmt_vid_cap
function.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarChristopher Díaz Riveros <chrisadr@gentoo.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent b605687c
...@@ -803,10 +803,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -803,10 +803,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
} }
if (f->fmt.pix.width >= LINE_SZ_4CIFS_NTSC) if (f->fmt.pix.width >= LINE_SZ_4CIFS_NTSC)
f->fmt.pix.width = LINE_SZ_4CIFS_NTSC; f->fmt.pix.width = LINE_SZ_4CIFS_NTSC;
else if (f->fmt.pix.width >= LINE_SZ_2CIFS_NTSC)
f->fmt.pix.width = LINE_SZ_2CIFS_NTSC;
else if (f->fmt.pix.width >= LINE_SZ_1CIFS_NTSC)
f->fmt.pix.width = LINE_SZ_1CIFS_NTSC;
else else
f->fmt.pix.width = LINE_SZ_1CIFS_NTSC; f->fmt.pix.width = LINE_SZ_1CIFS_NTSC;
} else { } else {
...@@ -820,10 +816,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -820,10 +816,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
} }
if (f->fmt.pix.width >= LINE_SZ_4CIFS_PAL) if (f->fmt.pix.width >= LINE_SZ_4CIFS_PAL)
f->fmt.pix.width = LINE_SZ_4CIFS_PAL; f->fmt.pix.width = LINE_SZ_4CIFS_PAL;
else if (f->fmt.pix.width >= LINE_SZ_2CIFS_PAL)
f->fmt.pix.width = LINE_SZ_2CIFS_PAL;
else if (f->fmt.pix.width >= LINE_SZ_1CIFS_PAL)
f->fmt.pix.width = LINE_SZ_1CIFS_PAL;
else else
f->fmt.pix.width = LINE_SZ_1CIFS_PAL; f->fmt.pix.width = LINE_SZ_1CIFS_PAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment