diff mbox

[RFCv1,2/6] videobuf2-core: use vb2_queue in __verify_planes_array

Message ID 09515c88fe0760fddd124ec86995dc2cfdd56e7a.1348064901.git.hans.verkuil@cisco.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans Verkuil Sept. 19, 2012, 2:37 p.m. UTC
From: Hans Verkuil <hans.verkuil@cisco.com>

Since num_planes has been moved to vb2_queue, the __verify_planes_array()
function can now switch to a vb2_queue argument as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/v4l2-core/videobuf2-core.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

On 09/19/2012 04:37 PM, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Since num_planes has been moved to vb2_queue, the __verify_planes_array()
> function can now switch to a vb2_queue argument as well.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index febc23b..2e26e58 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -274,10 +274,8 @@  static void __vb2_queue_free(struct vb2_queue *q, unsigned int buffers)
  * __verify_planes_array() - verify that the planes array passed in struct
  * v4l2_buffer from userspace can be safely used
  */
-static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer *b)
+static int __verify_planes_array(struct vb2_queue *q, const struct v4l2_buffer *b)
 {
-	struct vb2_queue *q = vb->vb2_queue;
-
 	/* Is memory for copying plane information present? */
 	if (NULL == b->m.planes) {
 		dprintk(1, "Multi-planar buffer passed but "
@@ -344,7 +342,7 @@  static int __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b)
 	b->reserved = vb->v4l2_buf.reserved;
 
 	if (V4L2_TYPE_IS_MULTIPLANAR(q->type)) {
-		ret = __verify_planes_array(vb, b);
+		ret = __verify_planes_array(q, b);
 		if (ret)
 			return ret;
 
@@ -831,7 +829,7 @@  static int __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b,
 		 * Verify that the userspace gave us a valid array for
 		 * plane information.
 		 */
-		ret = __verify_planes_array(vb, b);
+		ret = __verify_planes_array(q, b);
 		if (ret)
 			return ret;