Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1607405 > unrolled thread

[PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq

Started byColin King <colin.king@canonical.com>
First post2017-03-23 13:00 +0100
Last post2017-03-27 13:10 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq Colin King <colin.king@canonical.com> - 2017-03-23 13:00 +0100
    Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq Hans Verkuil <hverkuil@xs4all.nl> - 2017-03-27 11:50 +0200
      Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-27 12:20 +0200
        Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq walter harms <wharms@bfs.de> - 2017-03-27 13:10 +0200

#1607405 — [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq

FromColin King <colin.king@canonical.com>
Date2017-03-23 13:00 +0100
Subject[PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq
Message-ID<to9zk-1HJ-13@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

The call to v4ls_m2m_get_vq is only used to get the return value
which is not being used, so it appears to be redundant and can
be removed.

Detected with CoverityScan, CID#1420674 ("Useless call")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/media/platform/coda/coda-common.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 800d2477f1a0..95e4648f18e6 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -817,8 +817,6 @@ static int coda_qbuf(struct file *file, void *priv,
 static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx,
 				      struct vb2_v4l2_buffer *buf)
 {
-	v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
-
 	return ((ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG) &&
 		(buf->sequence == (ctx->qsequence - 1)));
 }
-- 
2.11.0

[toc] | [next] | [standalone]


#1609627

FromHans Verkuil <hverkuil@xs4all.nl>
Date2017-03-27 11:50 +0200
Message-ID<tpzrI-62q-31@gated-at.bofh.it>
In reply to#1607405
On 23/03/17 12:57, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The call to v4ls_m2m_get_vq is only used to get the return value
> which is not being used, so it appears to be redundant and can
> be removed.
> 
> Detected with CoverityScan, CID#1420674 ("Useless call")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/media/platform/coda/coda-common.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
> index 800d2477f1a0..95e4648f18e6 100644
> --- a/drivers/media/platform/coda/coda-common.c
> +++ b/drivers/media/platform/coda/coda-common.c
> @@ -817,8 +817,6 @@ static int coda_qbuf(struct file *file, void *priv,
>  static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx,
>  				      struct vb2_v4l2_buffer *buf)
>  {
> -	v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
> -
>  	return ((ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG) &&
>  		(buf->sequence == (ctx->qsequence - 1)));
>  }
> 

Philipp, is this correct, or should this actually check whether the queue is an
output queue?

Regards,

	Hans

[toc] | [prev] | [next] | [standalone]


#1609699

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-03-27 12:20 +0200
Message-ID<tpzUJ-6u4-5@gated-at.bofh.it>
In reply to#1609627
On Mon, 2017-03-27 at 11:46 +0200, Hans Verkuil wrote:
> On 23/03/17 12:57, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > The call to v4ls_m2m_get_vq is only used to get the return value
> > which is not being used, so it appears to be redundant and can
> > be removed.
> > 
> > Detected with CoverityScan, CID#1420674 ("Useless call")
> > 
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/media/platform/coda/coda-common.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
> > index 800d2477f1a0..95e4648f18e6 100644
> > --- a/drivers/media/platform/coda/coda-common.c
> > +++ b/drivers/media/platform/coda/coda-common.c
> > @@ -817,8 +817,6 @@ static int coda_qbuf(struct file *file, void *priv,
> >  static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx,
> >  				      struct vb2_v4l2_buffer *buf)
> >  {
> > -	v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
> > -
> >  	return ((ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG) &&
> >  		(buf->sequence == (ctx->qsequence - 1)));
> >  }
> > 
> 
> Philipp, is this correct, or should this actually check whether the queue is an
> output queue?

Yes, this was previously assigned to an unused local variable src_vq,
since initial commit 918c66fd4126 ("[media] coda: add CODA7541 decoding
support").

coda_buf_is_end_of_stream is called from coda_m2m_buf_done, which is
exclusively used on destination buffers on the capture queue.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

[toc] | [prev] | [next] | [standalone]


#1609738

Fromwalter harms <wharms@bfs.de>
Date2017-03-27 13:10 +0200
Message-ID<tpAH8-75T-5@gated-at.bofh.it>
In reply to#1609699

Am 27.03.2017 12:10, schrieb Philipp Zabel:
> On Mon, 2017-03-27 at 11:46 +0200, Hans Verkuil wrote:
>> On 23/03/17 12:57, Colin King wrote:
>>> From: Colin Ian King <colin.king@canonical.com>
>>>
>>> The call to v4ls_m2m_get_vq is only used to get the return value
>>> which is not being used, so it appears to be redundant and can
>>> be removed.
>>>
>>> Detected with CoverityScan, CID#1420674 ("Useless call")
>>>
>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>> ---
>>>  drivers/media/platform/coda/coda-common.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
>>> index 800d2477f1a0..95e4648f18e6 100644
>>> --- a/drivers/media/platform/coda/coda-common.c
>>> +++ b/drivers/media/platform/coda/coda-common.c
>>> @@ -817,8 +817,6 @@ static int coda_qbuf(struct file *file, void *priv,
>>>  static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx,
>>>  				      struct vb2_v4l2_buffer *buf)
>>>  {
>>> -	v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
>>> -
>>>  	return ((ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG) &&
>>>  		(buf->sequence == (ctx->qsequence - 1)));
>>>  }
>>>
>>
>> Philipp, is this correct, or should this actually check whether the queue is an
>> output queue?
> 
> Yes, this was previously assigned to an unused local variable src_vq,
> since initial commit 918c66fd4126 ("[media] coda: add CODA7541 decoding
> support").
> 
> coda_buf_is_end_of_stream is called from coda_m2m_buf_done, which is
> exclusively used on destination buffers on the capture queue.
> 
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> regards
> Philipp
> 

Is that function needed at all ?

re,
 wh

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web