Re: [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ezequiel,

On 08/23/2012 03:08 PM, Ezequiel Garcia wrote:
> queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
> a context struct v4l2_m2m_ctx with kzalloc.
> Therefore, there is no need to clear vb2_queue src/dst structs.
> 
> Signed-off-by: Ezequiel Garcia <elezegarcia@xxxxxxxxx>

Looks good to me. Let me pick this and s5p-jpeg, s5p-g2d patches for v3.7.

It might be good to add some kerneldoc documentation for v4l2_m2m_ctx_init()
function in include/media/v4l2-mem2mem.h, so it is clear what are exact
semantics for the queue_init callback.

Regards,
Sylwester

> ---
>  drivers/media/platform/mem2mem_testdev.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mem2mem_testdev.c b/drivers/media/platform/mem2mem_testdev.c
> index 51b6dd4..9a8b14f 100644
> --- a/drivers/media/platform/mem2mem_testdev.c
> +++ b/drivers/media/platform/mem2mem_testdev.c
> @@ -838,7 +838,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *ds
>  	struct m2mtest_ctx *ctx = priv;
>  	int ret;
>  
> -	memset(src_vq, 0, sizeof(*src_vq));
>  	src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
>  	src_vq->io_modes = VB2_MMAP;
>  	src_vq->drv_priv = ctx;
> @@ -850,7 +849,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *ds
>  	if (ret)
>  		return ret;
>  
> -	memset(dst_vq, 0, sizeof(*dst_vq));
>  	dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>  	dst_vq->io_modes = VB2_MMAP;
>  	dst_vq->drv_priv = ctx;
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux