{"id":11355,"url":"https://patchwork.libcamera.org/api/patches/11355/?format=json","web_url":"https://patchwork.libcamera.org/patch/11355/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210222104624.17643-1-laurent.pinchart@ideasonboard.com>","date":"2021-02-22T10:46:24","name":"[libcamera-devel] libcamera: raspberrypi: Drop std::move() where misleading","commit_ref":"1612841ff156023ff23ae5c8f4d68eeb09840a2a","pull_url":null,"state":"accepted","archived":false,"hash":"4607bd14a83908f7bc2513498237b38bf14318cf","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11355/mbox/","series":[{"id":1716,"url":"https://patchwork.libcamera.org/api/series/1716/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1716","date":"2021-02-22T10:46:24","name":"[libcamera-devel] libcamera: raspberrypi: Drop std::move() where misleading","version":1,"mbox":"https://patchwork.libcamera.org/series/1716/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11355/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11355/checks/","tags":{},"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 EAF64BD1F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Feb 2021 10:46:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7944968A05;\n\tMon, 22 Feb 2021 11:46:55 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 953C0602F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Feb 2021 11:46:54 +0100 (CET)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0ABE3344;\n\tMon, 22 Feb 2021 11:46:53 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"UFwMmlZy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1613990814;\n\tbh=CMemEp5XTK3/ab2Yxnpsz5MGvMzhyt7+vjqRTPO/dVU=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=UFwMmlZya4lqRlOZkSNfnNItvhJSlSbH/7Ic0uTWthyp+ZnvvJHr7qwIsfh+kZuZh\n\tC6wHOICscmlAZ/63u1VXv+RzZNRusu48CguEeUldQ6gwnSsBDGybwvsC9YmE5+XDfb\n\t+f5/fkIfLt/hrSthZ3snqu/mZvxVQKPo0iFCoSAA=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 22 Feb 2021 12:46:24 +0200","Message-Id":"<20210222104624.17643-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.28.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH] libcamera: raspberrypi: Drop std::move()\n\twhere misleading","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Usage of std::move() on a const lvalue will produce a const rvalue,\nwhich the compiler will bind to the const lvalue reference of the\nconstructor or assignement operator. This results in the object being\ncopied, not moved. Drop std::move() in that case as it's misleading.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 5bab313b5cc7..46b7c6dbba0a 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1289,7 +1289,7 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &\n \n \t/* Fill the Request metadata buffer with what the IPA has provided */\n \tRequest *request = requestQueue_.front();\n-\trequest->metadata() = std::move(controls);\n+\trequest->metadata() = controls;\n \n \t/*\n \t * Also update the ScalerCrop in the metadata with what we actually\n@@ -1338,7 +1338,7 @@ void RPiCameraData::embeddedComplete(uint32_t bufferId)\n \n void RPiCameraData::setIspControls(const ControlList &controls)\n {\n-\tControlList ctrls = std::move(controls);\n+\tControlList ctrls = controls;\n \n \tif (ctrls.contains(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING)) {\n \t\tControlValue &value =\n","prefixes":["libcamera-devel"]}