Commit 10e63904 authored by Daniel W. S. Almeida's avatar Daniel W. S. Almeida Committed by Mauro Carvalho Chehab
Browse files

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: default avatarDaniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 52cdded0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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;