kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq
@ 2017-03-23 11:57 Colin King
  2017-03-27  9:46 ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Colin King @ 2017-03-23 11:57 UTC (permalink / raw)
  To: Philipp Zabel, Mauro Carvalho Chehab, linux-media
  Cc: kernel-janitors, linux-kernel

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


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

* Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq
  2017-03-23 11:57 [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq Colin King
@ 2017-03-27  9:46 ` Hans Verkuil
  2017-03-27 10:10   ` Philipp Zabel
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2017-03-27  9:46 UTC (permalink / raw)
  To: Colin King, Philipp Zabel, Mauro Carvalho Chehab, linux-media
  Cc: kernel-janitors, linux-kernel

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

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

* Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq
  2017-03-27  9:46 ` Hans Verkuil
@ 2017-03-27 10:10   ` Philipp Zabel
  2017-03-27 11:04     ` walter harms
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Zabel @ 2017-03-27 10:10 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Colin King, Mauro Carvalho Chehab, linux-media, kernel-janitors,
	linux-kernel

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


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

* Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq
  2017-03-27 10:10   ` Philipp Zabel
@ 2017-03-27 11:04     ` walter harms
  0 siblings, 0 replies; 4+ messages in thread
From: walter harms @ 2017-03-27 11:04 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Hans Verkuil, Colin King, Mauro Carvalho Chehab, linux-media,
	kernel-janitors, linux-kernel



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

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

end of thread, other threads:[~2017-03-27 11:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 11:57 [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq Colin King
2017-03-27  9:46 ` Hans Verkuil
2017-03-27 10:10   ` Philipp Zabel
2017-03-27 11:04     ` walter harms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).