[v12,20/56] media: dvb-frontends: rtl2832: Stop direct calls to queue num_buffers field
Message ID | 20231017144756.34719-21-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:2908:b0:403:3b70:6f57 with SMTP id ib8csp4189158vqb; Tue, 17 Oct 2023 07:52:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPpwrmyO/ieA/qkRPLmITXGBvisUpiyrKn2EzOIiC+3iggnEuU0Y4PoiY6Ey6FB8bfJz1/ X-Received: by 2002:a05:6a21:8cc5:b0:15c:b7ba:e9ba with SMTP id ta5-20020a056a218cc500b0015cb7bae9bamr2142782pzb.0.1697554373998; Tue, 17 Oct 2023 07:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697554373; cv=none; d=google.com; s=arc-20160816; b=ow6fv3godiWm7knb0lQeMlwfrc4Tn76thl0von+WZT/vxskojL82TheoKdcMn5gV/v ZXlcRbPsPU+fDCoji5ZmLdQFDsfInu18T4osodHrKy0GmQptSf/3z/HA9iSiNDdpUIKu f0m4RLtj9xasVetA/RIWj9os7ed88191tmNfOdSj06eiHN5LSLuKvzQtf1z76wT8ampI 8rWqHi5aOf4LikcxrqQhJJjOo89Zalj9IrG0b2JC6Q8ziQ/sVEWDSeeQmCN9HEY2p+2b 84X0w6ANsTYBxg7gpIoj2VLeWi/0Xs7UUyTnaECJr5JpHAjkHvvvivR6QDb1BlWm+VlI EQgg== 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=6naI9jAgWYBGhWi1qqi3RabSUM4tX/YeV1rNn+0zlZU=; fh=p0AH8hgimiy85Lh1cXLIqpi5zFbeLa4s8fsQNMmUBzM=; b=fZG54LlSogSH1jGQoXUAP6i/zSOhL51XWPeMbIpeonlbYMnGv9nv6kF36m6YDVieJ1 ZiHAcyff9U5V5E6rNd686OyuRv7QzIoQtI6w0gaUDhklOsBU3m4JGTQR/JHqMjCAFM3R I6hBNOBStc9oNRSmnYZ1C5e26YU2CGxn8ZAFSa0Ltktf5qa/KRj8MVdq03ZjQwAU7O44 Rjc1CfvBC8jXobfmFw3AQFN1F5B6CytQAruEPHQ5cYViiN931hNiUMjewwOSWWka1i/s ygIOnHShVDI47ckzDQN0EJnFt4vvCRWy8omjOJRGis4o+bGCGXEIL29lejQr46lOb43g sxqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FTrfzkYO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id g5-20020a636b05000000b005ae38be0cd2si1879996pgc.835.2023.10.17.07.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:52:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FTrfzkYO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 5D17B8086913; Tue, 17 Oct 2023 07:52:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344157AbjJQOuY (ORCPT <rfc822;hjfbswb@gmail.com> + 20 others); Tue, 17 Oct 2023 10:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344217AbjJQOsY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 10:48:24 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4620E10E; Tue, 17 Oct 2023 07:48:15 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7205:da49:a7e8:59f8]) (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 B18FF66072F4; Tue, 17 Oct 2023 15:48:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697554094; bh=+SrUe883wLqq7v9G8MLuRZrzPHfSobRjkRT5Sxaur58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FTrfzkYOUFEaypOirJmchtUF+AvoupwvBQrV8f1KDKYHMxDadGxipG60O9gy9GCnf ozQGGLYmXJXb8lJEt2hyOPV/6PTCt/WdcNrpZTRY8hDOreYXS3xRJBCMmvHnGOKFj9 fG8oY1CRVJngNts00z3d6dOLpbgNJJKAyue9Ub0LtwycDZy+hXI9gAkGO0Z343TFIu etQ6pS+2yfwiWD53upzlrn1TMULf8oxHiD9rfKL8kquK8slae2FkzZtTL5VzL6RBl8 64Ug6UOByQDoG1JJ4GrMA7ZI3iuwxMUhj+AWmhSJOf1fn/4UseCir+2vGoGEiEIYIc ifU/87Db9cRMw== 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>, Antti Palosaari <crope@iki.fi> Subject: [PATCH v12 20/56] media: dvb-frontends: rtl2832: Stop direct calls to queue num_buffers field Date: Tue, 17 Oct 2023 16:47:20 +0200 Message-Id: <20231017144756.34719-21-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017144756.34719-1-benjamin.gaignard@collabora.com> References: <20231017144756.34719-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 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 pete.vger.email 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 (pete.vger.email [0.0.0.0]); Tue, 17 Oct 2023 07:52:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780014775400480176 X-GMAIL-MSGID: 1780014775400480176 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 17, 2023, 2:47 p.m. UTC
Use vb2_get_num_buffers() to avoid using queue num_buffers field directly.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
CC: Antti Palosaari <crope@iki.fi>
---
drivers/media/dvb-frontends/rtl2832_sdr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 02c619e51641..023db6e793f8 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -439,12 +439,13 @@ static int rtl2832_sdr_queue_setup(struct vb2_queue *vq, { struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); struct platform_device *pdev = dev->pdev; + unsigned int q_num_bufs = vb2_get_num_buffers(vq); dev_dbg(&pdev->dev, "nbuffers=%d\n", *nbuffers); /* Need at least 8 buffers */ - if (vq->num_buffers + *nbuffers < 8) - *nbuffers = 8 - vq->num_buffers; + if (q_num_bufs + *nbuffers < 8) + *nbuffers = 8 - q_num_bufs; *nplanes = 1; sizes[0] = PAGE_ALIGN(dev->buffersize); dev_dbg(&pdev->dev, "nbuffers=%d sizes[0]=%d\n", *nbuffers, sizes[0]);