mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] media: meson: vdec: remove redundant if statement
@ 2023-01-23  7:17 Christian Hewitt
  2023-01-23  8:49 ` Neil Armstrong
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Hewitt @ 2023-01-23  7:17 UTC (permalink / raw)
  To: Neil Armstrong, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-media,
	linux-amlogic, linux-staging, linux-arm-kernel, linux-kernel
  Cc: Benjamin Roszak

From: Benjamin Roszak <benjamin545@gmail.com>

Checking if sess->fmt_out->pixfmt is V4L2_PIX_FMT_VP9 was already done as a
condition to enter the if statement where this additional check is made.

Signed-off-by: Benjamin Roszak <benjamin545@gmail.com>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 drivers/staging/media/meson/vdec/esparser.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c
index 86ccc8937afc..7b15fc54efe4 100644
--- a/drivers/staging/media/meson/vdec/esparser.c
+++ b/drivers/staging/media/meson/vdec/esparser.c
@@ -314,8 +314,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf)
 			num_dst_bufs = codec_ops->num_pending_bufs(sess);
 
 		num_dst_bufs += v4l2_m2m_num_dst_bufs_ready(sess->m2m_ctx);
-		if (sess->fmt_out->pixfmt == V4L2_PIX_FMT_VP9)
-			num_dst_bufs -= 3;
+		num_dst_bufs -= 3;
 
 		if (esparser_vififo_get_free_space(sess) < payload_size ||
 		    atomic_read(&sess->esparser_queued_bufs) >= num_dst_bufs)
-- 
2.34.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] media: meson: vdec: remove redundant if statement
  2023-01-23  7:17 [PATCH] media: meson: vdec: remove redundant if statement Christian Hewitt
@ 2023-01-23  8:49 ` Neil Armstrong
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2023-01-23  8:49 UTC (permalink / raw)
  To: Christian Hewitt, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-media,
	linux-amlogic, linux-staging, linux-arm-kernel, linux-kernel
  Cc: Benjamin Roszak

On 23/01/2023 08:17, Christian Hewitt wrote:
> From: Benjamin Roszak <benjamin545@gmail.com>
> 
> Checking if sess->fmt_out->pixfmt is V4L2_PIX_FMT_VP9 was already done as a
> condition to enter the if statement where this additional check is made.
> 
> Signed-off-by: Benjamin Roszak <benjamin545@gmail.com>
> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
> ---
>   drivers/staging/media/meson/vdec/esparser.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c
> index 86ccc8937afc..7b15fc54efe4 100644
> --- a/drivers/staging/media/meson/vdec/esparser.c
> +++ b/drivers/staging/media/meson/vdec/esparser.c
> @@ -314,8 +314,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf)
>   			num_dst_bufs = codec_ops->num_pending_bufs(sess);
>   
>   		num_dst_bufs += v4l2_m2m_num_dst_bufs_ready(sess->m2m_ctx);
> -		if (sess->fmt_out->pixfmt == V4L2_PIX_FMT_VP9)
> -			num_dst_bufs -= 3;
> +		num_dst_bufs -= 3;
>   
>   		if (esparser_vififo_get_free_space(sess) < payload_size ||
>   		    atomic_read(&sess->esparser_queued_bufs) >= num_dst_bufs)


Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2023-01-23  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23  7:17 [PATCH] media: meson: vdec: remove redundant if statement Christian Hewitt
2023-01-23  8:49 ` Neil Armstrong

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

all inboxes | Powered by JetHome®