linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] videobuf2-v4l2: drop WARN_ON in vb2_warn_zero_bytesused()
@ 2018-11-19 15:33 Hans Verkuil
  2018-11-19 15:52 ` Ezequiel Garcia
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2018-11-19 15:33 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Ezequiel Garcia

Userspace shouldn't set bytesused to 0 for output buffers.
vb2_warn_zero_bytesused() warns about this (only once!), but it also
calls WARN_ON(1), which is confusing since it is not immediately clear
that it warns about a 0 value for bytesused.

Just drop the WARN_ON as it serves no purpose.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index a17033ab2c22..713326ef4e72 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -158,7 +158,6 @@ static void vb2_warn_zero_bytesused(struct vb2_buffer *vb)
 		return;

 	check_once = true;
-	WARN_ON(1);

 	pr_warn("use of bytesused == 0 is deprecated and will be removed in the future,\n");
 	if (vb->vb2_queue->allow_zero_bytesused)

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

* Re: [PATCH] videobuf2-v4l2: drop WARN_ON in vb2_warn_zero_bytesused()
  2018-11-19 15:33 [PATCH] videobuf2-v4l2: drop WARN_ON in vb2_warn_zero_bytesused() Hans Verkuil
@ 2018-11-19 15:52 ` Ezequiel Garcia
  0 siblings, 0 replies; 2+ messages in thread
From: Ezequiel Garcia @ 2018-11-19 15:52 UTC (permalink / raw)
  To: Hans Verkuil, Linux Media Mailing List

On Mon, 2018-11-19 at 16:33 +0100, Hans Verkuil wrote:
> Userspace shouldn't set bytesused to 0 for output buffers.
> vb2_warn_zero_bytesused() warns about this (only once!), but it also
> calls WARN_ON(1), which is confusing since it is not immediately clear
> that it warns about a 0 value for bytesused.
> 
> Just drop the WARN_ON as it serves no purpose.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Ezequiel Garcia <ezequiel@collabora.com>

> ---
> diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> index a17033ab2c22..713326ef4e72 100644
> --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
> +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> @@ -158,7 +158,6 @@ static void vb2_warn_zero_bytesused(struct vb2_buffer *vb)
>  		return;
> 
>  	check_once = true;
> -	WARN_ON(1);
> 
>  	pr_warn("use of bytesused == 0 is deprecated and will be removed in the future,\n");
>  	if (vb->vb2_queue->allow_zero_bytesused)

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

end of thread, other threads:[~2018-11-20  2:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 15:33 [PATCH] videobuf2-v4l2: drop WARN_ON in vb2_warn_zero_bytesused() Hans Verkuil
2018-11-19 15:52 ` Ezequiel Garcia

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).