public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: venus: fix duplicated code for different branches
@ 2017-08-17 23:12 Gustavo A. R. Silva
  2017-08-18  6:57 ` Hans Verkuil
  2017-08-18  7:52 ` Stanimir Varbanov
  0 siblings, 2 replies; 9+ messages in thread
From: Gustavo A. R. Silva @ 2017-08-17 23:12 UTC (permalink / raw)
  To: Stanimir Varbanov, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Gustavo A. R. Silva

Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1415317
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
This code was reported by Coverity and it was tested by compilation only.
Please, verify if this is an actual bug.

 drivers/media/platform/qcom/venus/helpers.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 5f4434c..8a5c467 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -240,11 +240,7 @@ static void return_buf_error(struct venus_inst *inst,
 {
 	struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx;
 
-	if (vbuf->vb2_buf.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
-		v4l2_m2m_src_buf_remove_by_buf(m2m_ctx, vbuf);
-	else
-		v4l2_m2m_src_buf_remove_by_buf(m2m_ctx, vbuf);
-
+	v4l2_m2m_src_buf_remove_by_buf(m2m_ctx, vbuf);
 	v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR);
 }
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-23 15:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17 23:12 [PATCH] media: venus: fix duplicated code for different branches Gustavo A. R. Silva
2017-08-18  6:57 ` Hans Verkuil
2017-08-18  7:52 ` Stanimir Varbanov
2017-08-18 15:55   ` Gustavo A. R. Silva
2017-08-18 16:07     ` [PATCH v2] venus: fix copy/paste error in return_buf_error Gustavo A. R. Silva
2017-08-21  9:14       ` Stanimir Varbanov
2017-08-22 19:22         ` Gustavo A. R. Silva
2017-08-23 12:59       ` Stanimir Varbanov
2017-08-23 15:14         ` Stanimir Varbanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox