[{"id":29658,"web_url":"https://patchwork.libcamera.org/comment/29658/","msgid":"<171699103924.191612.14542816305254123469@ping.linuxembedded.co.uk>","date":"2024-05-29T13:57:19","subject":"Re: [PATCH v1 2/6] test: fence: Turn class member variable into\n\tlocal variable","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-04-25 00:42:20)\n> The fence_ class member variable is only used locally in the\n> FenceTest::run() function. Make it a local variable.\n> \n\nThat looks easy.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  test/fence.cpp | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/test/fence.cpp b/test/fence.cpp\n> index 1e38bc2f8790..e6f79d2faa21 100644\n> --- a/test/fence.cpp\n> +++ b/test/fence.cpp\n> @@ -43,7 +43,6 @@ private:\n>  \n>         void signalFence();\n>  \n> -       std::unique_ptr<Fence> fence_;\n>         EventDispatcher *dispatcher_;\n>         UniqueFD eventFd_;\n>         UniqueFD eventFd2_;\n> @@ -274,13 +273,14 @@ int FenceTest::run()\n>                 int ret;\n>                 if (i == expiredRequestId_) {\n>                         /* This request will have a fence, and it will expire. */\n> -                       fence_ = std::make_unique<Fence>(std::move(eventFd_));\n> -                       if (!fence_->isValid()) {\n> +                       std::unique_ptr<Fence> fence =\n> +                               std::make_unique<Fence>(std::move(eventFd_));\n> +                       if (!fence->isValid()) {\n>                                 cerr << \"Fence should be valid\" << endl;\n>                                 return TestFail;\n>                         }\n>  \n> -                       ret = request->addBuffer(stream_, buffer.get(), std::move(fence_));\n> +                       ret = request->addBuffer(stream_, buffer.get(), std::move(fence));\n>                 } else {\n>                         /* All other requests will have no Fence. */\n>                         ret = request->addBuffer(stream_, buffer.get());\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 904FCBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 May 2024 13:57:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40BED634B6;\n\tWed, 29 May 2024 15:57:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A0F4A6347E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 May 2024 15:57:21 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 254BEB53;\n\tWed, 29 May 2024 15:57:18 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"i7psfkow\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1716991038;\n\tbh=piSC7lFnkAg7/QiMKSHqe3xWxnV60fVxYH/DSyprgZA=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=i7psfkow4xuSI5JaYqskX7jLnHRqonG0/Fxg3xuaNxDtq7CxAVjZB4saLXnGyuZvd\n\tddg5L7nY6o7B26XU+P++rj7wzotrewz2YUVFNyOdiHn0pOkhcLq7IL2iqZ97NaofGf\n\toYMYuVIRJkARiLqPfoDb/SL9BeWZA2J0PhYWpS6w=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240424234224.9658-3-laurent.pinchart@ideasonboard.com>","References":"<20240424234224.9658-1-laurent.pinchart@ideasonboard.com>\n\t<20240424234224.9658-3-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v1 2/6] test: fence: Turn class member variable into\n\tlocal variable","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 29 May 2024 14:57:19 +0100","Message-ID":"<171699103924.191612.14542816305254123469@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]