From patchwork Mon Oct 2 12:06:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 147490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1712390vqb; Mon, 2 Oct 2023 14:58:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcJOlI0N2RVB8xPBRLknwZljatx5ZaRIVWnhmyt4SSU4ABuOBpee7N0HUxrbw7jHuBysOt X-Received: by 2002:a05:6359:b82:b0:147:47f2:2d54 with SMTP id gf2-20020a0563590b8200b0014747f22d54mr10030131rwb.0.1696283895643; Mon, 02 Oct 2023 14:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696283895; cv=none; d=google.com; s=arc-20160816; b=nAer2uiyZ7h2oHo2qdTjTag+15x/eGvEJ7netCh+ghw5u5lM0p9ZPhaGQhNvwCmWzr gbDRABJwZOKyU1rhR9EMr5neB2dZqSmtWGul4uma8j0i5lhTmeAvZl9pTjcaqkBFAyUD RoaQ7eDVGxM8f+5P+auR9435eR4tYFl8hxP83JQNkAcPzKpkm33viitwJkd9IU7yaAb0 wxczhU0Qefvr0k5FQnztf+hSqLj1JbFkbmlVXErvWGL2Z+QOUn0kU5GP27SmaVO2U1H3 totZ5VFZnLxdS/NDvThyhV52rzmb3nk9lLvnllYkjgA5ulfZeUouyi/RYiNhBJ0wZ2fs A3ug== 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=5R/PgQ9e5CNPNqndSb4rIVp3OPzOtN9sFynvrYOHk1Q=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=pmn3LuaHKRkuPf78ZKQ1D8QjEY+7cvZ92hvW13mEh4ixOWWw04/42jDfeER16Hf/LI MRi07/sG3/gTw3k8hfLGTiOFf7ywJBy0JHEQ4GuL6N7UTZ9eXhdGLksCHTc6mKengX/e r3JnbF28sqEXfeCVEoK6azLadmUtaRjVu81b4YeDeTdqH/3pPXbKJr0lJzrfXUHBQy6h +oNarHJ4vOgN6hPi+egH+NP3ZEsl4JtO58N0Pkv7tVBGFNnGvi4PnKwxNjkINNo6/KIx I7tJ6ppXim/V/JxTbMeL1Frssn1q36JPtWOQjSD00dvsmQFmvuU23KCZnKPJK3vbJ+zl xIig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eQHuKCA3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id bx6-20020a056a00428600b00690bd5a0bccsi28087547pfb.363.2023.10.02.14.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 14:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eQHuKCA3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 875B88135297; Mon, 2 Oct 2023 05:08:58 -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 S237425AbjJBMIi (ORCPT + 18 others); Mon, 2 Oct 2023 08:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237120AbjJBMHA (ORCPT ); Mon, 2 Oct 2023 08:07:00 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 983E9136; Mon, 2 Oct 2023 05:06:48 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:9537:67ca:c85e:d0ae]) (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 F1EAA6607381; Mon, 2 Oct 2023 13:06:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1696248407; bh=g+cKvL+57Ge4BbEO/J6pfXbFnIiiN4vCjyxapf5D6Zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQHuKCA3Xp8gjVQseFQD8UEiSrYFCBmOghamozW4V7vqv8PW1+ELxXEyJjrLD7yPM v4147Dxr1grPRsoWHy8CZ0aOWhsYs4ITpfKs1+c/Je/OfeV/t2bAY8QrodHwjsNS7G wNAoL9efYHIFzSGRg0FCWD7DuzpBpvktlJhIBnKO21OHWtDaKd1+oXvJXAM+QcoPIv hq1w9l1ziKj59L84bOKMzs2p+YlkxMgR5f3wXXP3mzl1Qfiovfm8AOD6N42wMTSDY6 oz6r616/uqrT5kF37Z+BZe+i40O9Xffq5pIB33cf+GPWlY+g6oET09/U+cVrE1NmEz MxkN2ZxnguNdA== From: Benjamin Gaignard 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 Subject: [PATCH v9 42/53] media: atomisp: Stop direct calls to queue num_buffers field Date: Mon, 2 Oct 2023 14:06:06 +0200 Message-Id: <20231002120617.119602-43-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002120617.119602-1-benjamin.gaignard@collabora.com> References: <20231002120617.119602-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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 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: 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]); Mon, 02 Oct 2023 05:08:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778682582042791975 X-GMAIL-MSGID: 1778682582042791975 Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by: Benjamin Gaignard --- 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 4b65c69fa60d..48f9745421a9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1030,7 +1030,7 @@ static int atomisp_qbuf_wrapper(struct file *file, void *fh, struct v4l2_buffer struct atomisp_device *isp = video_get_drvdata(vdev); struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev); - if (buf->index >= vdev->queue->num_buffers) + if (buf->index >= vb2_get_num_buffers(vdev->queue)) return -EINVAL; if (buf->reserved2 & ATOMISP_BUFFER_HAS_PER_FRAME_SETTING) {