From patchwork Wed Sep 19 14:37:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1477841 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 408BE3FE65 for ; Wed, 19 Sep 2012 14:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558Ab2ISOi1 (ORCPT ); Wed, 19 Sep 2012 10:38:27 -0400 Received: from smtp-vbr8.xs4all.nl ([194.109.24.28]:2818 "EHLO smtp-vbr8.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790Ab2ISOi0 (ORCPT ); Wed, 19 Sep 2012 10:38:26 -0400 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166]) (authenticated bits=0) by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8JEbhSi057171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 19 Sep 2012 16:37:44 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.lan (tschai.lan [192.168.1.10]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 6887235C013B; Wed, 19 Sep 2012 16:37:42 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Pawel Osciak , Marek Szyprowski , Hans Verkuil Subject: [RFCv1 PATCH 2/6] videobuf2-core: use vb2_queue in __verify_planes_array Date: Wed, 19 Sep 2012 16:37:36 +0200 Message-Id: <09515c88fe0760fddd124ec86995dc2cfdd56e7a.1348064901.git.hans.verkuil@cisco.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348065460-1624-1-git-send-email-hverkuil@xs4all.nl> References: <1348065460-1624-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <9e4acd70e02bb67e6e7af0c236c69af27108e4fa.1348064901.git.hans.verkuil@cisco.com> References: <9e4acd70e02bb67e6e7af0c236c69af27108e4fa.1348064901.git.hans.verkuil@cisco.com> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Hans Verkuil 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 Reviewed-by: Sylwester Nawrocki Tested-by: Sylwester Nawrocki --- drivers/media/v4l2-core/videobuf2-core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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;