[media] omap: simplify test logic
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 3 Sep 2014 18:46:32 +0000 (15:46 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 3 Sep 2014 20:59:25 +0000 (17:59 -0300)
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>
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap/omap_vout_vrfb.c

index d9258f3d0f8e0af2127eb1975abf91fbdc6b1bd3..64ab6fb06b9c6ed478661a93f7fdf8424422237a 100644 (file)
@@ -989,7 +989,7 @@ static int omap_vout_release(struct file *file)
                mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN |
                        DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_VSYNC2;
                omap_dispc_unregister_isr(omap_vout_isr, vout, mask);
-               vout->streaming = 0;
+               vout->streaming = false;
 
                videobuf_streamoff(q);
                videobuf_queue_cancel(q);
@@ -1644,7 +1644,7 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
        vout->field_id = 0;
 
        /* set flag here. Next QBUF will start DMA */
-       vout->streaming = 1;
+       vout->streaming = true;
 
        vout->first_int = 1;
 
@@ -1704,7 +1704,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
        if (!vout->streaming)
                return -EINVAL;
 
-       vout->streaming = 0;
+       vout->streaming = false;
        mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD
                | DISPC_IRQ_VSYNC2;
 
@@ -1912,7 +1912,7 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
        control[0].id = V4L2_CID_ROTATE;
        control[0].value = 0;
        vout->rotation = 0;
-       vout->mirror = 0;
+       vout->mirror = false;
        vout->control[2].id = V4L2_CID_HFLIP;
        vout->control[2].value = 0;
        if (vout->vid_info.rotation_type == VOUT_ROT_VRFB)
index 62e7e5783ce809c52f8905d482bb7aa232a3c287..aa39306afc73ac84439655314460acfa3202b43d 100644 (file)
@@ -148,7 +148,7 @@ int omap_vout_setup_vrfb_bufs(struct platform_device *pdev, int vid_num,
                        ret =  -ENOMEM;
                        goto release_vrfb_ctx;
                }
-               vout->vrfb_static_allocation = 1;
+               vout->vrfb_static_allocation = true;
        }
        return 0;
 
@@ -336,7 +336,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
                offset = vout->vrfb_context[0].yoffset *
                        vout->vrfb_context[0].bytespp;
                temp_ps = ps / vr_ps;
-               if (mirroring == 0) {
+               if (!mirroring) {
                        *cropped_offset = offset + line_length *
                                temp_ps * cleft + crop->top * temp_ps;
                } else {
@@ -350,7 +350,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
                        vout->vrfb_context[0].bytespp) +
                        (vout->vrfb_context[0].xoffset *
                        vout->vrfb_context[0].bytespp));
-               if (mirroring == 0) {
+               if (!mirroring) {
                        *cropped_offset = offset + (line_length * ps * ctop) +
                                (cleft / vr_ps) * ps;
 
@@ -364,7 +364,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
                offset = MAX_PIXELS_PER_LINE * vout->vrfb_context[0].xoffset *
                        vout->vrfb_context[0].bytespp;
                temp_ps = ps / vr_ps;
-               if (mirroring == 0) {
+               if (!mirroring) {
                        *cropped_offset = offset + line_length *
                            temp_ps * crop->left + ctop * ps;
                } else {
@@ -375,7 +375,7 @@ void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout)
                }
                break;
        case dss_rotation_0_degree:
-               if (mirroring == 0) {
+               if (!mirroring) {
                        *cropped_offset = (line_length * ps) *
                                crop->top + (crop->left / vr_ps) * ps;
                } else {