From patchwork Thu Nov 9 16:29:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 163473 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp557203vqs; Thu, 9 Nov 2023 08:35:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjJk+dVcv4A6slEdC4dbtPMxpjAUidgnp991IW58KpFE8LPTTt7nQdacd6GKI6w9y2UNRc X-Received: by 2002:a17:902:9004:b0:1cc:3875:e654 with SMTP id a4-20020a170902900400b001cc3875e654mr5080579plp.26.1699547751439; Thu, 09 Nov 2023 08:35:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699547751; cv=none; d=google.com; s=arc-20160816; b=L0oKJlBanwU18R16bD/1vaRSTRFc6AtH8MtzXQ3Ow0i62aSN3RvFrFv7ugKa/VI/G9 ZO++IhJFR5+GaOqjDZOshL1I9ksh1eqP7eLW2COfOVpax7Txp3eh3sPXT0sRYudQtCdM KdBgu6+d/Gp4xzYsQ04GrRQuemaFPIlKbVanTMwJYMdEV/392Jgb8xfKjRiOrqczwRoz E+KPHSpaWQqtvaYF25puGPQ8GdbRegoMXO5RC93AVuwRTTLHC74thdBa/RcVBYJVqEER N/mwCuO5OvoEGFYOgH1VGK741x2DfXNBWCV83ou+dMQ3/J01N94A3St1ZCjdQeJSdHt3 Pp3Q== 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=Z3v4YYWXwB0wHHCry4PnzcR+jZLbf+PsckN31czrG0Q=; fh=TmD+hhsp9BmE1gM0frR1Tlg23bmw2sQ+w3SEIAdpcT8=; b=DPR2FmgksAGTHRUIdPSy8d1Y4WVGsI75JyFF5t/kiBbTWAqhS0ao7IB8hafx8GaHKP 2HkZbDg9aFcIOsSnIawBKAXNQKa1GHHFehW37FbbUoZ+nNLnEpPRLP1yrWYParNdfN2G XhiKaVUEaockHUPYsP0PxlxL1pnOX6aZAgCXfTyZCWFpASWoDrt+1NTB4P4lzJx90GCM Tm/Pzw7SGlxOta0Rh2I6o3CQcvvahaJ3OugedEYSPwo7BDVd7aQx8IUzS+Ah2CehJ31m G20wcznybavL3a+14CDfbbD3A9YhbomFsgdzAgAI/9tpuF/bquUCsYhsPlQP/BBCMv4X a+kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Lg1B/sY4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u1-20020a170902e80100b001c6223663b3si5450705plg.369.2023.11.09.08.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:35:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Lg1B/sY4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id C6E6D81D6BF7; Thu, 9 Nov 2023 08:34:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344194AbjKIQdZ (ORCPT + 31 others); Thu, 9 Nov 2023 11:33:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344189AbjKIQc6 (ORCPT ); Thu, 9 Nov 2023 11:32:58 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F27235B1; Thu, 9 Nov 2023 08:32:52 -0800 (PST) Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (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 E47DA660740E; Thu, 9 Nov 2023 16:32:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547571; bh=ooMOEdtDZIUUYspZ5HrBt+e7386S7f+z9SbtFLqLXjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lg1B/sY4CMho6ryc98suqBf3QfgL9YTr6Xoql296q6pbuP+54n3guJjrI3osWBWqo yiThaMeJ9yTcg8A4IrkfksUVLCF5uOvPKYiFSwdCOPZ+TmrS7BIXnUbWfIBEt6DqZv wLguXgKeNJiALpKHUyFYKNE9vD9P9gfPm7yrjjZx/fJX10MZGhvITexJ96b9ZyvW+p 2l02c6jjkZg3hBLp/bBYpV1wO7PGd2T+8mfmte2ZpSBr9z8Ot/FMx9bSw5u+4v5vkI rJG4C4xyw5+sXGQjfK/r5XHdfok1jKpL/nrYlF/S8tvPEcjoHy7E5WxCkGAxb9CjfN JFSwVx19iUWwA== 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 , Andrzej Pietrasiewicz , Bin Liu , Matthias Brugger Subject: [PATCH v15 12/56] media: mediatek: vdec: Remove useless loop Date: Thu, 9 Nov 2023 17:29:24 +0100 Message-Id: <20231109163008.179152-13-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231109163008.179152-1-benjamin.gaignard@collabora.com> References: <20231109163008.179152-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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 (fry.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:34:45 -0800 (PST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782104983227026885 X-GMAIL-MSGID: 1782104983227026885 Simplify code by removing useless loop by using video buffer index. Signed-off-by: Benjamin Gaignard Reviewed-by: Andrzej Pietrasiewicz CC: Bin Liu CC: Matthias Brugger --- .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c index e393e3e668f8..69d37b93bd35 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c @@ -1695,13 +1695,8 @@ static int vdec_vp9_slice_setup_core_buffer(struct vdec_vp9_slice_instance *inst return -EINVAL; /* update internal buffer's width/height */ - for (i = 0; i < vq->num_buffers; i++) { - if (vb == vq->bufs[i]) { - instance->dpb[i].width = w; - instance->dpb[i].height = h; - break; - } - } + instance->dpb[vb->index].width = w; + instance->dpb[vb->index].height = h; /* * get buffer's width/height from instance