From patchwork Wed May 29 15:43:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20120 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D8A18BDE6B for ; Wed, 29 May 2024 15:44:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6249C634C0; Wed, 29 May 2024 17:44:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gYIxZEMV"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F02296347E for ; Wed, 29 May 2024 17:43:55 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F8394AB for ; Wed, 29 May 2024 17:43:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716997432; bh=aWyNEfpdBLxbG3criPCarWk/z+V33hVRZwveudno5xg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gYIxZEMV84ikaqMFxnAvp0cEolhVh7xFsJnhtBoZXNC/N33T/xtB6UuBf5NPQ+4us 7ekpK3/s/r8SdvDnxTQJbn0VNgdw7dQiuyem6k/PfthvsVg7ZS6LrVoVNHXxkiZGrP ii6S9UicflLIgGDc4+b6M0N/LcrAJ15frQ8NfXZ4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 2/6] test: fence: Turn class member variable into local variable Date: Wed, 29 May 2024 18:43:37 +0300 Message-ID: <20240529154341.10426-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240529154341.10426-1-laurent.pinchart@ideasonboard.com> References: <20240529154341.10426-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The fence_ class member variable is only used locally in the FenceTest::run() function. Make it a local variable. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Daniel Scally --- test/fence.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fence.cpp b/test/fence.cpp index ada650ff2417..c282886287aa 100644 --- a/test/fence.cpp +++ b/test/fence.cpp @@ -43,7 +43,6 @@ private: void signalFence(); - std::unique_ptr fence_; EventDispatcher *dispatcher_; UniqueFD eventFd_; UniqueFD eventFd2_; @@ -274,13 +273,14 @@ int FenceTest::run() int ret; if (i == expiredRequestId_) { /* This request will have a fence, and it will expire. */ - fence_ = std::make_unique(std::move(eventFd_)); - if (!fence_->isValid()) { + std::unique_ptr fence = + std::make_unique(std::move(eventFd_)); + if (!fence->isValid()) { cerr << "Fence should be valid" << endl; return TestFail; } - ret = request->addBuffer(stream_, buffer.get(), std::move(fence_)); + ret = request->addBuffer(stream_, buffer.get(), std::move(fence)); } else { /* All other requests will have no Fence. */ ret = request->addBuffer(stream_, buffer.get());