From patchwork Mon Feb 22 10:46:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 11355 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 EAF64BD1F6 for ; Mon, 22 Feb 2021 10:46:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7944968A05; Mon, 22 Feb 2021 11:46:55 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UFwMmlZy"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 953C0602F3 for ; Mon, 22 Feb 2021 11:46:54 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0ABE3344; Mon, 22 Feb 2021 11:46:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613990814; bh=CMemEp5XTK3/ab2Yxnpsz5MGvMzhyt7+vjqRTPO/dVU=; h=From:To:Cc:Subject:Date:From; b=UFwMmlZya4lqRlOZkSNfnNItvhJSlSbH/7Ic0uTWthyp+ZnvvJHr7qwIsfh+kZuZh C6wHOICscmlAZ/63u1VXv+RzZNRusu48CguEeUldQ6gwnSsBDGybwvsC9YmE5+XDfb +f5/fkIfLt/hrSthZ3snqu/mZvxVQKPo0iFCoSAA= From: Laurent Pinchart 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() where misleading 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" Usage of std::move() on a const lvalue will produce a const rvalue, which the compiler will bind to the const lvalue reference of the constructor or assignement operator. This results in the object being copied, not moved. Drop std::move() in that case as it's misleading. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 5bab313b5cc7..46b7c6dbba0a 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1289,7 +1289,7 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList & /* Fill the Request metadata buffer with what the IPA has provided */ Request *request = requestQueue_.front(); - request->metadata() = std::move(controls); + request->metadata() = controls; /* * Also update the ScalerCrop in the metadata with what we actually @@ -1338,7 +1338,7 @@ void RPiCameraData::embeddedComplete(uint32_t bufferId) void RPiCameraData::setIspControls(const ControlList &controls) { - ControlList ctrls = std::move(controls); + ControlList ctrls = controls; if (ctrls.contains(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING)) { ControlValue &value =