From patchwork Wed Apr 24 23:42:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19947 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 954AFC3200 for ; Wed, 24 Apr 2024 23:42:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DEA19633FB; Thu, 25 Apr 2024 01:42:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ba37gPqE"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ECB7861A94 for ; Thu, 25 Apr 2024 01:42:32 +0200 (CEST) Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C3EE2B1 for ; Thu, 25 Apr 2024 01:41:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1714002100; bh=+UX0BOvEyE9vdmhREGzttYT+/eC/61yXaL1AdtqIfZ0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ba37gPqEfkjewX0evWolvWTtM/1XI668dvVn8AhR1wB64LJ8ujXGxxxovZwTACYV1 71+JSM7PoVwIf1FjCddbuPH33y6MySsoOX3aMIf2BwhUMr5euVwHvA+KZFJEX1HlLQ rLbMfTbSgC5zeqB8D0YIqWVT3KR4M7u3TI5Xu+Ec= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 2/6] test: fence: Turn class member variable into local variable Date: Thu, 25 Apr 2024 02:42:20 +0300 Message-ID: <20240424234224.9658-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240424234224.9658-1-laurent.pinchart@ideasonboard.com> References: <20240424234224.9658-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 --- test/fence.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fence.cpp b/test/fence.cpp index 1e38bc2f8790..e6f79d2faa21 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());