aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-03 14:46:32 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-03 16:59:25 -0400
commit160ac0babc0d8c382bdf32db238bf16a3d3fa0a5 (patch)
tree248d61c9911d3d3c23464b80c589f22d8b163ef4 /drivers/media/platform/omap
parent1b21e2187adea385d9de53c8c861d9f56ea5bebe (diff)
[media] omap: simplify test logic
instead of testing bools if they are false or true, just use if (!foo) or if (foo). That makes the code easier to read and shorter. Also, properly initialize booleans with true or false. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/omap')
-rw-r--r--drivers/media/platform/omap/omap_vout.c8
-rw-r--r--drivers/media/platform/omap/omap_vout_vrfb.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index d9258f3d0f8e..64ab6fb06b9c 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -989,7 +989,7 @@ static int omap_vout_release(struct file *file)
989 mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN | 989 mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN |
990 DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_VSYNC2; 990 DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_VSYNC2;
991 omap_dispc_unregister_isr(omap_vout_isr, vout, mask); 991 omap_dispc_unregister_isr(omap_vout_isr, vout, mask);
992 vout->streaming = 0; 992 vout->streaming = false;
993 993
994 videobuf_streamoff(q); 994 videobuf_streamoff(q);
995 videobuf_queue_cancel(q); 995 videobuf_queue_cancel(q);
@@ -1644,7 +1644,7 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
1644 vout->field_id = 0; 1644 vout->field_id = 0;
1645 1645
1646 /* set flag here. Next QBUF will start DMA */ 1646 /* set flag here. Next QBUF will start DMA */
1647 vout->streaming = 1; 1647 vout->streaming = true;
1648 1648
1649 vout->first_int = 1; 1649 vout->first_int = 1;
1650 1650
@@ -1704,7 +1704,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
1704 if (!vout->streaming) 1704 if (!vout->streaming)
1705 return -EINVAL; 1705 return -EINVAL;
1706 1706
1707 vout->streaming = 0; 1707 vout->streaming = false;
1708 mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD 1708 mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD
1709 | DISPC_IRQ_VSYNC2; 1709 | DISPC_IRQ_VSYNC2;
1710 1710
@@ -1912,7 +1912,7 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
1912 control[0].id = V4L2_CID_ROTATE; 1912 control[0].id = V4L2_CID_ROTATE;
1913 control[0].value = 0; 1913 control[0].value = 0;
1914 vout->rotation = 0; 1914 vout->rotation = 0;
1915 vout->mirror = 0; 1915 vout->mirror = false;
1916 vout->control[2].id = V4L2_CID_HFLIP; 1916 vout->control[2].id = V4L2_CID_HFLIP;
1917 vout->control[2].value = 0; 1917 vout->control[2].value = 0;
1918 if (vout->vid_info.rotation_type == VOUT_ROT_VRFB) 1918 if (vout->vid_info.rotation_type == VOUT_ROT_VRFB)
diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c
index 62e7e5783ce8..aa39306afc73 100644
--- a/drivers/media/platform/omap/omap_vout_vrfb.c
+++ b/drivers/media/platform/omap/omap_vout_vrfb.c
@@ -148,7 +148,7 @@ int omap_vout_setup_vrfb_bufs(struct platform_device *pdev, int vid_num,
148 ret = -ENOMEM; 148 ret = -ENOMEM;
149 goto release_vrfb_ctx; 149 goto release_vrfb_ctx;
150 } 150 }
151 vout->vrfb_static_allocation = 1; 151 vout->vrfb_static_allocation = true;
152 } 152 }
153 return 0; 153 return 0;
154 154
@@ -336,7 +336,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
336 offset = vout->vrfb_context[0].yoffset * 336 offset = vout->vrfb_context[0].yoffset *
337 vout->vrfb_context[0].bytespp; 337 vout->vrfb_context[0].bytespp;
338 temp_ps = ps / vr_ps; 338 temp_ps = ps / vr_ps;
339 if (mirroring == 0) { 339 if (!mirroring) {
340 *cropped_offset = offset + line_length * 340 *cropped_offset = offset + line_length *
341 temp_ps * cleft + crop->top * temp_ps; 341 temp_ps * cleft + crop->top * temp_ps;
342 } else { 342 } else {
@@ -350,7 +350,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
350 vout->vrfb_context[0].bytespp) + 350 vout->vrfb_context[0].bytespp) +
351 (vout->vrfb_context[0].xoffset * 351 (vout->vrfb_context[0].xoffset *
352 vout->vrfb_context[0].bytespp)); 352 vout->vrfb_context[0].bytespp));
353 if (mirroring == 0) { 353 if (!mirroring) {
354 *cropped_offset = offset + (line_length * ps * ctop) + 354 *cropped_offset = offset + (line_length * ps * ctop) +
355 (cleft / vr_ps) * ps; 355 (cleft / vr_ps) * ps;
356 356
@@ -364,7 +364,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
364 offset = MAX_PIXELS_PER_LINE * vout->vrfb_context[0].xoffset * 364 offset = MAX_PIXELS_PER_LINE * vout->vrfb_context[0].xoffset *
365 vout->vrfb_context[0].bytespp; 365 vout->vrfb_context[0].bytespp;
366 temp_ps = ps / vr_ps; 366 temp_ps = ps / vr_ps;
367 if (mirroring == 0) { 367 if (!mirroring) {
368 *cropped_offset = offset + line_length * 368 *cropped_offset = offset + line_length *
369 temp_ps * crop->left + ctop * ps; 369 temp_ps * crop->left + ctop * ps;
370 } else { 370 } else {
@@ -375,7 +375,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
375 } 375 }
376 break; 376 break;
377 case dss_rotation_0_degree: 377 case dss_rotation_0_degree:
378 if (mirroring == 0) { 378 if (!mirroring) {
379 *cropped_offset = (line_length * ps) * 379 *cropped_offset = (line_length * ps) *
380 crop->top + (crop->left / vr_ps) * ps; 380 crop->top + (crop->left / vr_ps) * ps;
381 } else { 381 } else {