Commit 3038f638 authored by Leonid V. Fedorenchik's avatar Leonid V. Fedorenchik Committed by Greg Kroah-Hartman

Staging: cx25821: Replace :? by if-else in cx25821-video.c

Replace :? operator by equivalent if-else statement where in improves
readability. Don't add else branch if it is not needed.
Signed-off-by: default avatarLeonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e313e1f9
...@@ -599,8 +599,8 @@ int cx25821_buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, ...@@ -599,8 +599,8 @@ int cx25821_buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
if (init_buffer) { if (init_buffer) {
channel_opened = dev->channel_opened; channel_opened = dev->channel_opened;
channel_opened = (channel_opened < 0 if (channel_opened < 0 || channel_opened > 7)
|| channel_opened > 7) ? 7 : channel_opened; channel_opened = 7;
if (dev->channels[channel_opened].pixel_formats == if (dev->channels[channel_opened].pixel_formats ==
PIXEL_FRMT_411) PIXEL_FRMT_411)
...@@ -840,8 +840,10 @@ static int video_open(struct file *file) ...@@ -840,8 +840,10 @@ static int video_open(struct file *file)
fh->height = 480; fh->height = 480;
dev->channel_opened = fh->channel_id; dev->channel_opened = fh->channel_id;
pix_format = (dev->channels[ch_id].pixel_formats == PIXEL_FRMT_411) ? if (dev->channels[ch_id].pixel_formats == PIXEL_FRMT_411)
V4L2_PIX_FMT_Y41P : V4L2_PIX_FMT_YUYV; pix_format = V4L2_PIX_FMT_Y41P;
else
pix_format = V4L2_PIX_FMT_YUYV;
fh->fmt = cx25821_format_by_fourcc(pix_format); fh->fmt = cx25821_format_by_fourcc(pix_format);
v4l2_prio_open(&dev->channels[ch_id].prio, &fh->prio); v4l2_prio_open(&dev->channels[ch_id].prio, &fh->prio);
...@@ -1124,8 +1126,10 @@ int cx25821_vidioc_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -1124,8 +1126,10 @@ int cx25821_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
maxh = 576; maxh = 576;
if (V4L2_FIELD_ANY == field) { if (V4L2_FIELD_ANY == field) {
field = (f->fmt.pix.height > maxh / 2) if (f->fmt.pix.height > maxh / 2)
? V4L2_FIELD_INTERLACED : V4L2_FIELD_TOP; field = V4L2_FIELD_INTERLACED;
else
field = V4L2_FIELD_TOP;
} }
switch (field) { switch (field) {
...@@ -1847,8 +1851,10 @@ static long video_ioctl_set(struct file *file, unsigned int cmd, ...@@ -1847,8 +1851,10 @@ static long video_ioctl_set(struct file *file, unsigned int cmd,
switch (command) { switch (command) {
case SET_VIDEO_STD: case SET_VIDEO_STD:
dev->tvnorm = !strcmp(data_from_user->vid_stdname, "PAL") ? if (!strcmp(data_from_user->vid_stdname, "PAL"))
V4L2_STD_PAL_BG : V4L2_STD_NTSC_M; dev->tvnorm = V4L2_STD_PAL_BG;
else
dev->tvnorm = V4L2_STD_NTSC_M;
medusa_set_videostandard(dev); medusa_set_videostandard(dev);
break; break;
...@@ -1874,11 +1880,13 @@ static long video_ioctl_set(struct file *file, unsigned int cmd, ...@@ -1874,11 +1880,13 @@ static long video_ioctl_set(struct file *file, unsigned int cmd,
if (cif_enable) { if (cif_enable) {
if (dev->tvnorm & V4L2_STD_PAL_BG if (dev->tvnorm & V4L2_STD_PAL_BG
|| dev->tvnorm & V4L2_STD_PAL_DK) || dev->tvnorm & V4L2_STD_PAL_DK) {
width = 352; width = 352;
else } else {
width = (cif_width == 320 || cif_width == 352) ? width = cif_width;
cif_width : 320; if (cif_width != 320 && cif_width != 352)
width = 320;
}
} }
if (!(selected_channel <= 7 && selected_channel >= 0)) { if (!(selected_channel <= 7 && selected_channel >= 0)) {
......
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