linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing
@ 2012-08-23 13:08 Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 02/10] pwc: " Ezequiel Garcia
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia

struct vb2_queue is allocated through kzalloc as part of a larger struct,
there's no need to clear it.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/usb/stk1160/stk1160-v4l.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index cc5a95f..fe6e857 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -676,7 +676,6 @@ int stk1160_vb2_setup(struct stk1160 *dev)
 	struct vb2_queue *q;
 
 	q = &dev->vb_vidq;
-	memset(q, 0, sizeof(dev->vb_vidq));
 	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	q->io_modes = VB2_READ | VB2_MMAP | VB2_USERPTR;
 	q->drv_priv = dev;
-- 
1.7.8.6


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

* [PATCH 02/10] pwc: Remove unneeded struct vb2_queue clearing
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-09-09 21:57   ` Hans de Goede
  2012-08-23 13:08 ` [PATCH 03/10] vivi: " Ezequiel Garcia
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Hans de Goede

struct vb2_queue is allocated through kzalloc as part of a larger struct,
there's no need to clear it.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/usb/pwc/pwc-if.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index de7c7ba..825c61a 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -994,7 +994,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 	pdev->power_save = my_power_save;
 
 	/* Init videobuf2 queue structure */
-	memset(&pdev->vb_queue, 0, sizeof(pdev->vb_queue));
 	pdev->vb_queue.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	pdev->vb_queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ;
 	pdev->vb_queue.drv_priv = pdev;
-- 
1.7.8.6


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

* [PATCH 03/10] vivi: Remove unneeded struct vb2_queue clearing
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 02/10] pwc: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init() Ezequiel Garcia
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia

struct vb2_queue is allocated through kzalloc as part of a larger struct,
there's no need to clear it.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/vivi.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c
index a6351c4..fca8019 100644
--- a/drivers/media/platform/vivi.c
+++ b/drivers/media/platform/vivi.c
@@ -1306,7 +1306,6 @@ static int __init vivi_create_instance(int inst)
 
 	/* initialize queue */
 	q = &dev->vb_vidq;
-	memset(q, 0, sizeof(dev->vb_vidq));
 	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ;
 	q->drv_priv = dev;
-- 
1.7.8.6


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

* [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 02/10] pwc: " Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 03/10] vivi: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-23 13:49   ` Sylwester Nawrocki
  2012-08-23 13:08 ` [PATCH 05/10] coda: " Ezequiel Garcia
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia

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@gmail.com>
---
 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;
-- 
1.7.8.6


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

* [PATCH 05/10] coda: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
                   ` (2 preceding siblings ...)
  2012-08-23 13:08 ` [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init() Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-24  6:21   ` javier Martin
  2012-08-23 13:08 ` [PATCH 06/10] mem2mem-deinterlace: " Ezequiel Garcia
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Javier Martin

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.

Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/coda.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index 6908514..3ea822f 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -1249,7 +1249,6 @@ static int coda_queue_init(void *priv, struct vb2_queue *src_vq,
 	struct coda_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;
@@ -1261,7 +1260,6 @@ static int coda_queue_init(void *priv, struct vb2_queue *src_vq,
 	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;
-- 
1.7.8.6


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

* [PATCH 06/10] mem2mem-deinterlace: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
                   ` (3 preceding siblings ...)
  2012-08-23 13:08 ` [PATCH 05/10] coda: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 07/10] mem2mem-emmaprp: " Ezequiel Garcia
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Javier Martin

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.

Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/m2m-deinterlace.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index a38c152..9afd930 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -861,7 +861,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	struct deinterlace_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 | VB2_USERPTR;
 	src_vq->drv_priv = ctx;
@@ -878,7 +877,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	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 | VB2_USERPTR;
 	dst_vq->drv_priv = ctx;
-- 
1.7.8.6


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

* [PATCH 07/10] mem2mem-emmaprp: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
                   ` (4 preceding siblings ...)
  2012-08-23 13:08 ` [PATCH 06/10] mem2mem-deinterlace: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-24  6:22   ` javier Martin
  2012-08-23 13:08 ` [PATCH 08/10] s5p-fimc: " Ezequiel Garcia
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Javier Martin

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.

Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/mx2_emmaprp.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
index dab380a..59aaca4 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -757,7 +757,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	struct emmaprp_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 | VB2_USERPTR;
 	src_vq->drv_priv = ctx;
@@ -769,7 +768,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	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 | VB2_USERPTR;
 	dst_vq->drv_priv = ctx;
-- 
1.7.8.6


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

* [PATCH 08/10] s5p-fimc: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
                   ` (5 preceding siblings ...)
  2012-08-23 13:08 ` [PATCH 07/10] mem2mem-emmaprp: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 09/10] s5p-jpeg: " Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 10/10] s5p-g2d: " Ezequiel Garcia
  8 siblings, 0 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Sylwester Nawrocki

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.

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/s5p-fimc/fimc-m2m.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-fimc/fimc-m2m.c b/drivers/media/platform/s5p-fimc/fimc-m2m.c
index c587011..ab4c15a 100644
--- a/drivers/media/platform/s5p-fimc/fimc-m2m.c
+++ b/drivers/media/platform/s5p-fimc/fimc-m2m.c
@@ -620,7 +620,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	struct fimc_ctx *ctx = priv;
 	int ret;
 
-	memset(src_vq, 0, sizeof(*src_vq));
 	src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
 	src_vq->io_modes = VB2_MMAP | VB2_USERPTR;
 	src_vq->drv_priv = ctx;
@@ -632,7 +631,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	if (ret)
 		return ret;
 
-	memset(dst_vq, 0, sizeof(*dst_vq));
 	dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
 	dst_vq->io_modes = VB2_MMAP | VB2_USERPTR;
 	dst_vq->drv_priv = ctx;
-- 
1.7.8.6


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

* [PATCH 09/10] s5p-jpeg: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
                   ` (6 preceding siblings ...)
  2012-08-23 13:08 ` [PATCH 08/10] s5p-fimc: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  2012-08-23 13:08 ` [PATCH 10/10] s5p-g2d: " Ezequiel Garcia
  8 siblings, 0 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Andrzej Pietrasiewicz

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.

Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 72c3e52..90459cef 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1223,7 +1223,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	struct s5p_jpeg_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 | VB2_USERPTR;
 	src_vq->drv_priv = ctx;
@@ -1235,7 +1234,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	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 | VB2_USERPTR;
 	dst_vq->drv_priv = ctx;
-- 
1.7.8.6


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

* [PATCH 10/10] s5p-g2d: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
                   ` (7 preceding siblings ...)
  2012-08-23 13:08 ` [PATCH 09/10] s5p-jpeg: " Ezequiel Garcia
@ 2012-08-23 13:08 ` Ezequiel Garcia
  8 siblings, 0 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2012-08-23 13:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Ezequiel Garcia, Kamil Debski

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.

Cc: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 drivers/media/platform/s5p-g2d/g2d.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
index 0edc2df..30195ef 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -151,7 +151,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	struct g2d_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 | VB2_USERPTR;
 	src_vq->drv_priv = ctx;
@@ -163,7 +162,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 	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 | VB2_USERPTR;
 	dst_vq->drv_priv = ctx;
-- 
1.7.8.6


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

* Re: [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 ` [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init() Ezequiel Garcia
@ 2012-08-23 13:49   ` Sylwester Nawrocki
  2012-08-23 14:04     ` Sylwester Nawrocki
  0 siblings, 1 reply; 15+ messages in thread
From: Sylwester Nawrocki @ 2012-08-23 13:49 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Mauro Carvalho Chehab, linux-media

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@gmail.com>

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;

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

* Re: [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:49   ` Sylwester Nawrocki
@ 2012-08-23 14:04     ` Sylwester Nawrocki
  0 siblings, 0 replies; 15+ messages in thread
From: Sylwester Nawrocki @ 2012-08-23 14:04 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Mauro Carvalho Chehab, linux-media

On 08/23/2012 03:49 PM, Sylwester Nawrocki wrote:
> 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@gmail.com>
> 
> Looks good to me. Let me pick this and s5p-jpeg, s5p-g2d patches for v3.7.

whoops, I'll just pick s5p driver patches, i.e. 3 last ones in this series
 -  08/10, 09/10, 10/10 as I have other patches touching these drivers.

--
Regards,
Sylwester


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

* Re: [PATCH 05/10] coda: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 ` [PATCH 05/10] coda: " Ezequiel Garcia
@ 2012-08-24  6:21   ` javier Martin
  0 siblings, 0 replies; 15+ messages in thread
From: javier Martin @ 2012-08-24  6:21 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Mauro Carvalho Chehab, linux-media

On 23 August 2012 15:08, Ezequiel Garcia <elezegarcia@gmail.com> 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.
>
> Cc: Javier Martin <javier.martin@vista-silicon.com>
> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
> ---
>  drivers/media/platform/coda.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
> index 6908514..3ea822f 100644
> --- a/drivers/media/platform/coda.c
> +++ b/drivers/media/platform/coda.c
> @@ -1249,7 +1249,6 @@ static int coda_queue_init(void *priv, struct vb2_queue *src_vq,
>         struct coda_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;
> @@ -1261,7 +1260,6 @@ static int coda_queue_init(void *priv, struct vb2_queue *src_vq,
>         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;
> --
> 1.7.8.6
>

Acked-By: Javier Martin <javier.martin@vista-silicon.com>


-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

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

* Re: [PATCH 07/10] mem2mem-emmaprp: Remove unneeded struct vb2_queue clear on queue_init()
  2012-08-23 13:08 ` [PATCH 07/10] mem2mem-emmaprp: " Ezequiel Garcia
@ 2012-08-24  6:22   ` javier Martin
  0 siblings, 0 replies; 15+ messages in thread
From: javier Martin @ 2012-08-24  6:22 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Mauro Carvalho Chehab, linux-media

On 23 August 2012 15:08, Ezequiel Garcia <elezegarcia@gmail.com> 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.
>
> Cc: Javier Martin <javier.martin@vista-silicon.com>
> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
> ---
>  drivers/media/platform/mx2_emmaprp.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
> index dab380a..59aaca4 100644
> --- a/drivers/media/platform/mx2_emmaprp.c
> +++ b/drivers/media/platform/mx2_emmaprp.c
> @@ -757,7 +757,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
>         struct emmaprp_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 | VB2_USERPTR;
>         src_vq->drv_priv = ctx;
> @@ -769,7 +768,6 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
>         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 | VB2_USERPTR;
>         dst_vq->drv_priv = ctx;
> --
> 1.7.8.6
>

Acked-By: Javier Martin <javier.martin@vista-silicon.com>

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

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

* Re: [PATCH 02/10] pwc: Remove unneeded struct vb2_queue clearing
  2012-08-23 13:08 ` [PATCH 02/10] pwc: " Ezequiel Garcia
@ 2012-09-09 21:57   ` Hans de Goede
  0 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2012-09-09 21:57 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Mauro Carvalho Chehab, linux-media

Hi,

Thanks! Applied to my gspca / media / pwc tree and included in my pull-req for 3.7 which I just send out.

Regards,

Hans


On 08/23/2012 03:08 PM, Ezequiel Garcia wrote:
> struct vb2_queue is allocated through kzalloc as part of a larger struct,
> there's no need to clear it.
>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
> ---
>   drivers/media/usb/pwc/pwc-if.c |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
> index de7c7ba..825c61a 100644
> --- a/drivers/media/usb/pwc/pwc-if.c
> +++ b/drivers/media/usb/pwc/pwc-if.c
> @@ -994,7 +994,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
>   	pdev->power_save = my_power_save;
>
>   	/* Init videobuf2 queue structure */
> -	memset(&pdev->vb_queue, 0, sizeof(pdev->vb_queue));
>   	pdev->vb_queue.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>   	pdev->vb_queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ;
>   	pdev->vb_queue.drv_priv = pdev;
>

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

end of thread, other threads:[~2012-09-09 21:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 13:08 [PATCH 01/10] stk1160: Remove unneeded struct vb2_queue clearing Ezequiel Garcia
2012-08-23 13:08 ` [PATCH 02/10] pwc: " Ezequiel Garcia
2012-09-09 21:57   ` Hans de Goede
2012-08-23 13:08 ` [PATCH 03/10] vivi: " Ezequiel Garcia
2012-08-23 13:08 ` [PATCH 04/10] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init() Ezequiel Garcia
2012-08-23 13:49   ` Sylwester Nawrocki
2012-08-23 14:04     ` Sylwester Nawrocki
2012-08-23 13:08 ` [PATCH 05/10] coda: " Ezequiel Garcia
2012-08-24  6:21   ` javier Martin
2012-08-23 13:08 ` [PATCH 06/10] mem2mem-deinterlace: " Ezequiel Garcia
2012-08-23 13:08 ` [PATCH 07/10] mem2mem-emmaprp: " Ezequiel Garcia
2012-08-24  6:22   ` javier Martin
2012-08-23 13:08 ` [PATCH 08/10] s5p-fimc: " Ezequiel Garcia
2012-08-23 13:08 ` [PATCH 09/10] s5p-jpeg: " Ezequiel Garcia
2012-08-23 13:08 ` [PATCH 10/10] s5p-g2d: " 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).