From 10e639041e003eadd2309bd332c03f83cbcdf0ca Mon Sep 17 00:00:00 2001 From: "Daniel W. S. Almeida" Date: Fri, 7 Aug 2020 10:35:33 +0200 Subject: [PATCH] media: mtk-vcodec: mtk_vcodec_dec.c: fix comparison to bool Fix the following coccinelle reports: drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:197:14-35: WARNING: Comparison to bool drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:198:7-29: WARNING: Comparison to bool drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:451:12-19: WARNING: Comparison to bool drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:1159:6-15: WARNING: Comparison to bool By replacing (cond == true) with (cond) and (cond == false) with (!cond) Found using - Coccinelle (http://coccinelle.lip6.fr) Signed-off-by: Daniel W. S. Almeida Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c index 25b2ac03243d..c768a587a944 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c @@ -194,8 +194,7 @@ static struct vb2_buffer *get_free_buffer(struct mtk_vcodec_ctx *ctx) vb->vb2_buf.index, dstbuf->queued_in_vb2); v4l2_m2m_buf_queue(ctx->m2m_ctx, vb); - } else if ((dstbuf->queued_in_vb2 == false) && - (dstbuf->queued_in_v4l2 == true)) { + } else if (!dstbuf->queued_in_vb2 && dstbuf->queued_in_v4l2) { /* * If buffer in v4l2 driver but not in vb2 queue yet, * and we get this buffer from free_list, it means @@ -448,7 +447,7 @@ static void mtk_vdec_worker(struct work_struct *work) mutex_unlock(&ctx->lock); } v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_ERROR); - } else if (res_chg == false) { + } else if (!res_chg) { /* * we only return src buffer with VB2_BUF_STATE_DONE * when decode success without resolution change @@ -1156,7 +1155,7 @@ static void vb2ops_vdec_buf_queue(struct vb2_buffer *vb) buf = container_of(vb2_v4l2, struct mtk_video_dec_buf, m2m_buf.vb); mutex_lock(&ctx->lock); - if (buf->used == false) { + if (!buf->used) { v4l2_m2m_buf_queue(ctx->m2m_ctx, vb2_v4l2); buf->queued_in_vb2 = true; buf->queued_in_v4l2 = true; -- 2.39.5