From patchwork Thu Oct 12 11:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 151991 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1166735vqb; Thu, 12 Oct 2023 04:51:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvHCWmjOrD9Dityhh5fnqvGM1rQ7i9cDiPNLvJKYPKBAmNZ49o0KMAaVfeCctpJKBwzmXE X-Received: by 2002:a05:6a00:1d22:b0:693:38c5:4d6d with SMTP id a34-20020a056a001d2200b0069338c54d6dmr26416641pfx.2.1697111504141; Thu, 12 Oct 2023 04:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697111504; cv=none; d=google.com; s=arc-20160816; b=VHJzMzULP9Dt0jR2aQpxLxmk+3nQ8mhauMMNVJC+lVe+jXg24lA6hB3hVPnvBp0VNZ NHcW/e8vdjB26bVzhhWlXKrJLiXSa1yHxxGcIJCgmjTl67tNRlRuUGxnXP8rkal2BZSn +Ktz45EGo5ykcNAJpB4J+IyGZ7S3PTaplfO9K1BsCCBK9NaeZkBFytofWESQ9dmMV/7i PBXQUUgzQ0bneKTTn+SYNSg5lcmMADrDs/fOHDprI9oE5MD9YEyV5Q2KaduMUZFXxAuS AOVcCaXfYQRfpMf32B84Zs0Tim/ciDEYQ6Mh6GdC4R1zoQyyFLFr2Cw1b3DEAOERKAGH LL+w== 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=HUGdxYhOAn1TeNjwpyRJvPl+LJMl1y9M+zopjIghSVc=; fh=zA4Ea09BAmiDPPjR+uJVAnHTWLSizmgLd0oTzclis+o=; b=B6YCZoqx2/Oatir1SpWF3LL9gE/3mvbVjq1BkfY4Bt3wBGd1YYt7Jncep0ICMec98F wg1qMq5mqOUb6yA09nnZjeHkBEdsvXIQrVTa+4UbHMbyGJZDuEtOHOowgUk0l5bkhvkU UexCJCr8uum810m/Fw9wYURwR+cwQjv+tLfglwShrEMg3ekopx3E+Z01uzo7jTYiAvtX 2PsJXKe9wpSt9Al5X0IcPk0OE+/qTJs4ypLZDD+oOEyvfFEHndy8m2BMOiw0MflktYJA VzdfAVLynxzE+acUNRXJ46WfNQmptFTka0VrQigLFHSj9kuiSZd+eV58GsVqQgde6sD5 liUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S+BZk8df; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y4-20020a056a00180400b0069026254582si14866244pfa.98.2023.10.12.04.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:51:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S+BZk8df; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 1338A8379A5A; Thu, 12 Oct 2023 04:51:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378422AbjJLLti (ORCPT + 19 others); Thu, 12 Oct 2023 07:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378972AbjJLLre (ORCPT ); Thu, 12 Oct 2023 07:47:34 -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 85996FD; Thu, 12 Oct 2023 04:47:13 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7ae7:b86d:c19a:877e]) (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 C84C76607359; Thu, 12 Oct 2023 12:47:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697111232; bh=wcmCqoCWnm3znNuFzs/XictU3y+G/8bndqFUAwDdrfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+BZk8dfAmvxBWrALG+owBFsVHdcRGqSqKhhr4l8ZcJp1jy3j5/ZUKIYroVNVwzsn z6kFVAryYiu2EaQruCBoWMD/SXFWFOe+UF7YIFFpYcOvXG/J+EVxYBDWqZa6s/SqaZ 5N1MiXSV2PftsdU2s4KSkEMyYl0duJe+XP1UPfAEbCpgMtaAyBjc6geM9EXLXv3cG8 ctfEu1WgQnSoqB1xwPGB38DJlzFQCDU+vqEjlp6ah4bmHnL/731BtJXW3ejCsSHJpe ACerqsYA6wOyCobEUO9Bahwe20vDZRLw4BSojKNI3EeWt1ks1PWi2neOlITQ9FLDuV 3zSWibJQbL9kA== 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 , Joseph Liu , Marvin Lin Subject: [PATCH v11 42/56] media: nuvoton: Stop direct calls to queue num_buffers field Date: Thu, 12 Oct 2023 13:46:28 +0200 Message-Id: <20231012114642.19040-43-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012114642.19040-1-benjamin.gaignard@collabora.com> References: <20231012114642.19040-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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 morse.vger.email 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 (morse.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:51:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779550392720040230 X-GMAIL-MSGID: 1779550392720040230 Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. Signed-off-by: Benjamin Gaignard CC: Joseph Liu CC: Marvin Lin --- drivers/media/platform/nuvoton/npcm-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c index b9e6782f59b4..f9b4e36a5175 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -393,7 +393,7 @@ static void npcm_video_free_diff_table(struct npcm_video *video) struct rect_list *tmp; unsigned int i; - for (i = 0; i < video->queue.num_buffers; i++) { + for (i = 0; i < vb2_get_num_buffers(&video->queue); i++) { head = &video->list[i]; list_for_each_safe(pos, nx, head) { tmp = list_entry(pos, struct rect_list, list);