diff options
author | 2020-08-07 10:35:33 +0200 | |
---|---|---|
committer | 2020-08-29 07:47:54 +0200 | |
commit | 10e639041e003eadd2309bd332c03f83cbcdf0ca (patch) | |
tree | fea039b38a45ce530c6ee4d1fb3eb7843fe9f25b | |
parent | media: cobalt: cobalt-omnitek.c: fix comparison to bool (diff) | |
download | linux-10e639041e003eadd2309bd332c03f83cbcdf0ca.tar.gz linux-10e639041e003eadd2309bd332c03f83cbcdf0ca.tar.bz2 linux-10e639041e003eadd2309bd332c03f83cbcdf0ca.zip |
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 <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 7 |
1 files 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; |