[v14,16/56] media: atomisp: Use vb2_get_buffer() instead of directly access to buffers array
Message ID | 20231031163104.112469-17-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp363362vqg; Tue, 31 Oct 2023 09:32:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgDcZ2wK0TM9zDyWIWKnfRus5YOghUnrx+HJAaq1bS6ZtbZU6JEZyLG1GM7+h4uVEhgYTD X-Received: by 2002:a17:903:10a:b0:1cc:6101:2086 with SMTP id y10-20020a170903010a00b001cc61012086mr2909812plc.11.1698769967903; Tue, 31 Oct 2023 09:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698769967; cv=none; d=google.com; s=arc-20160816; b=URvDJt0+trUbY4nYIykfM+qHDUqp01ncoKtvK1mlVpKASsEFnmPfN1zUhgimFW82hh DABVTzPcHQaTUxe52onYSEx1WlbY9CNVwm7V/mMMvmFYwzo7PoCI4nxyO4p/xgyujhlm A1lTBPp+iZKydrxHBAbmdsjoP19wMDZOnR3Hr09QolZsp3ML/lkEicXDVJE54a2vp5Be wkSXUYwAh03qKaS9IFyOQeXf/2lBnPDax22DKXsrKF73xNNKIa8fUSSsRaZaUVEm26ZV yRUmAvZXrtWySW5aNnxsT2I6+lUYnxNBK5RRHAAo5s+AIyAi6DqP274WFm/o+0n/2BG7 JpQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VM4NzMJMGv79npf1U7MuzJpl4mPtUAdgVx8a3O8ahTM=; fh=O6aRB12iLfQPcoaBoN6ND3UiYcgSMHP3FYKR6EKS/0Q=; b=evmFoHiopHOdEGAEeFzKjIiv6YgvHb9CLKFfXDu+F7NdLmwf6iY9hIKaxIdgbq18CO bIjPb99K4mWYxsNke2/VeGNDBKvDiNIi9dSIqFzWrE2sC8tNQwDld3Ff0IwoPcWQdQPN g/Z3sqwt5hwm8fvX78q4HJqJHi4rUawxwgAA3SQtPDZFPEjV40JiEORA0bnP0JycujOd UJm8cVBMtu+q2Ji45jJqJk/0JIkYCqLh3B+aO7HsImYW98ozrYiDfbR3uGSEtlKJqzMT CNwTKmzOSH8gcRYcDidHBqb/Hu+/AFcsDP1tQuwSM+doSs5DrM+wiImgkQgwcKgoDZoi MNfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iQKS2gOK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u17-20020a170903125100b001cc4a373875si943711plh.459.2023.10.31.09.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iQKS2gOK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8632F801B40C; Tue, 31 Oct 2023 09:32:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345439AbjJaQcf (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 33 others); Tue, 31 Oct 2023 12:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345478AbjJaQby (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Oct 2023 12:31:54 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE36DF; Tue, 31 Oct 2023 09:31:39 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:c562:2ef4:80c0:92f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id BD29566073BC; Tue, 31 Oct 2023 16:31:37 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698769898; bh=NE9Dr0xaEnB6dw9lflcnBD1PZMhluEk9SDENx9Slyak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iQKS2gOKh29M6gADjnFecd6BtcW9lEPqL9EqQsHyxZChFkLLplz5LqyVwf9dxzLI3 EsJnRW8DZXBq7h4n625gxvk8yvPJL44wtjItbfSVxn7IiIAXqTvvtd98NK8Mf+monY buR+LZbZoTIpTTkde4vhN2xbSJRMEqlvPPs9Dm0Wuz7z2jdLbtz1eExFInkzTPCHKr JVLWNr4Az59GbnxDzpRNlfgOcv8ssMMXvdB9qHABocjufFybK8PHkOi74FFRfSHU/K iLGpe/EU4BjWUQo1A91+CTaWi6NgY0m0o/TjAr+jRH9GQKgOJdOx6QV96SUZJ3OzW/ PV3jEaGmny9PQ== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Hans de Goede <hdegoede@redhat.com>, Sakari Ailus <sakari.ailus@linux.intel.com> Subject: [PATCH v14 16/56] media: atomisp: Use vb2_get_buffer() instead of directly access to buffers array Date: Tue, 31 Oct 2023 17:30:24 +0100 Message-Id: <20231031163104.112469-17-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231031163104.112469-1-benjamin.gaignard@collabora.com> References: <20231031163104.112469-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:32:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781289418024193573 X-GMAIL-MSGID: 1781289418024193573 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 31, 2023, 4:30 p.m. UTC
Use vb2_get_buffer() instead of direct access to the vb2_queue bufs array. This allows us to change the type of the bufs in the future. No need to check the result of vb2_get_buffer, vb2_ioctl_dqbuf() already checked that it is valid. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> CC: Mauro Carvalho Chehab <mchehab@kernel.org> CC: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index a8e4779d007f..a8a964b2f1a8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1059,7 +1059,7 @@ static int atomisp_dqbuf_wrapper(struct file *file, void *fh, struct v4l2_buffer if (ret) return ret; - vb = pipe->vb_queue.bufs[buf->index]; + vb = vb2_get_buffer(&pipe->vb_queue, buf->index); frame = vb_to_frame(vb); buf->reserved = asd->frame_status[buf->index];