Message ID | 20230914133323.198857-34-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp359184vqi; Thu, 14 Sep 2023 06:45:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7dBDu1YNBNUkJuqwIbYn/llBlkdYNaffgrT5h7A5SQA+E8oyEfmHE+Vh29FZzQM4nra0m X-Received: by 2002:a17:902:e748:b0:1bb:8e13:deba with SMTP id p8-20020a170902e74800b001bb8e13debamr6003691plf.11.1694699145613; Thu, 14 Sep 2023 06:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694699145; cv=none; d=google.com; s=arc-20160816; b=d/XLo0xBYoQjpN9jMt6H8xawebZDGpQOGN34sNldeIkHVTuS5DCHFyTiamd0f73F9v 0sRJzP8Fis2Vrvd+Kz3O2wImjvdGInWBjXBMAD0nzZc9kOsFahZ7jf9umB2NDjwzGhpg WgBp47Bs8efqBdrpmmnNTIy0cO8lp5C8f1mZ5ASpfZdTBrTI2dY9WGSp4mB1nssaiOjZ IErwXi9+76GB5kNqRRCx5jJ98+kYAQk04H/UqFi0WoW9RYfuZaF01b0eJcHGDtP7Hm6x ZncqhU1w/Us0svuhzXpoBxZlhlItWhmq9id1736d9si5uW1lWiVhItvUzLbjTTukmY0M VzPg== 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=YuTUXwwrjQhGjkZuYgcK/Bhhrcrd12yf6DwoX1wzW74=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=QdLRk7TDlI4bWMYrxh75K77C1+jNPfxnGC7O9k+AhuDezASJ10a6Z5U94hcUs8Q1di gEJfhhy3EH85epMkQ51y8ELkmzPaKij/eJov5htP7TiBMt5x/gNxr8xKcrCIPktX807O WRsPKRF4tojcpwFZBSARwVb4Oz/GMUnh+0x6xHUD0EHaHqPJR0RXWRl67vMTYHrB/zut riwj6eLelt//qRrjzqU+hTRXi80vsfpRyg/I7cUWtEACYmhd9Bsp3vU//a7sBG7tHZMS fRcH+nOC72/yfxv8EPYdb/cMgunV3uM6CPFWYgxR75dehEI3+oTDekq0CAzUZDCCCc9P EgNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DaoUlmXC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b13-20020a170903228d00b001bbad3b063bsi1822469plh.345.2023.09.14.06.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 06:45:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DaoUlmXC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id EDC8581DC600; Thu, 14 Sep 2023 06:36:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239613AbjINNfE (ORCPT <rfc822;chrisfriedt@gmail.com> + 35 others); Thu, 14 Sep 2023 09:35:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239567AbjINNe3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 09:34:29 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9F53268F; Thu, 14 Sep 2023 06:33:49 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:36f2:37bd:ccbb:373f]) (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 5F0C16607384; Thu, 14 Sep 2023 14:33:48 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694698428; bh=5agb5+731PbAsmHV0HkXiz/yWnDWBOST3c/elC0GOlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DaoUlmXCrWVmNSTPHSiU0Kze4b4dAxEsiAESC1T1RfI/N0JSuqIQOAC/pOIRJqpy4 IbiKdjzHMO2qLKCSGrfwliIrQojFUKgG/R/Z1Y8pDeP6+bXkNYoQMnC9Z+Z/rJbhyh ph1SM0l0l8VshDQXmDv920KdJUit/rNECupZfAv3ipHMW2mHAJZK2iQe9A78H0W+z5 U9e+q85xg3sPaR4acMAVSHtDAB2q2JzFEMfNO7e7bHQSMKz5rZa9qW8iLkDBflDnLd K1VEIXpGL0dy6JQifII9yJzBQQ3XK/ZRpK3MU+1qOSgK9QLT7h7/zBDb0jjd+91lC/ UOgkav/mWZIrQ== 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> Subject: [PATCH v7 33/49] media: sti: hva: Stop direct calls to queue num_buffers field Date: Thu, 14 Sep 2023 15:33:07 +0200 Message-Id: <20230914133323.198857-34-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914133323.198857-1-benjamin.gaignard@collabora.com> References: <20230914133323.198857-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (lipwig.vger.email [0.0.0.0]); Thu, 14 Sep 2023 06:36:01 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777020850917967271 X-GMAIL-MSGID: 1777020850917967271 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Sept. 14, 2023, 1:33 p.m. UTC
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/media/platform/st/sti/hva/hva-v4l2.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/media/platform/st/sti/hva/hva-v4l2.c b/drivers/media/platform/st/sti/hva/hva-v4l2.c index 326be09bdb55..cfe83e9dc01b 100644 --- a/drivers/media/platform/st/sti/hva/hva-v4l2.c +++ b/drivers/media/platform/st/sti/hva/hva-v4l2.c @@ -569,13 +569,6 @@ static int hva_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) struct vb2_buffer *vb2_buf; vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, buf->type); - - if (buf->index >= vq->num_buffers) { - dev_dbg(dev, "%s buffer index %d out of range (%d)\n", - ctx->name, buf->index, vq->num_buffers); - return -EINVAL; - } - vb2_buf = vb2_get_buffer(vq, buf->index); if (!vb2_buf) { dev_dbg(dev, "%s buffer index %d not found\n", ctx->name, buf->index);