From patchwork Mon Mar 22 22:09:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11644 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 ADBDEC32E1 for ; Mon, 22 Mar 2021 22:09:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 18B0468D66; Mon, 22 Mar 2021 23:09:19 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AjtD4S4o"; dkim-atps=neutral Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9AD1B68D62 for ; Mon, 22 Mar 2021 23:09:17 +0100 (CET) Received: by mail-pg1-x533.google.com with SMTP id k24so9700465pgl.6 for ; Mon, 22 Mar 2021 15:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gtDt9IQmG5dXc60NE2nDlS6dRsMzi8BpaZkWgC3RoDg=; b=AjtD4S4oOvFStplAavrDzuNiYKcSwrlFusWrtGyv/3eHWYSnxZaH88CSb+P1n40n7Q dbEHNCesuTYEZfoLVsXmPFLQm61rESBvp0a6GnBWKFOYVf1lKvDY9fu+TRM9tec4M2TA Ggkx/G5BLaNu0lURvoQtMbMVpR4mabWBTaEXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gtDt9IQmG5dXc60NE2nDlS6dRsMzi8BpaZkWgC3RoDg=; b=L9oUfZUUwm3tdEe4QZNJ4HU0jemRYqprlpplU/LsG1VW4ZBNt8vR6woat3r6Oogy+U PaKT62gOGef9aqxQ/zdBD4nwsSQLOr+Gfihs5AZX2LbIsNAPrMAsvo9BNBPnOeFA2Fqd /p9lDSlsA55fn+uV00HXTxly9Fj6k1tOo5Rpf77TODb9LlMeH/hV4tsBxYWWStcKyu1N l1IP7K7BWM+y908TNym6c6XYFk+2VdKZt/gOT/U19NDGxGr3sXxbtQmT43KF4591NR+O mlJJPYXscaZ/vW5xZsL+abIV+XdZzoKZQq9TTWPiUYrjxnwud2vBeuTdeXG0O/mqs69l 3kBg== X-Gm-Message-State: AOAM532wvCMiGHPb3qiU36ie7BC7EHG/wj6Je6LQ6KDO4s2UXnQ7KSkh KGISMBqGgPSIfvRz4KmWIotCLS7oj2otsA== X-Google-Smtp-Source: ABdhPJz29yGPu0iF6BR4gsTlCFQ5KhWbqgGzHWEuF3SDVlOmWbjSyINz/Cs5dt3ubHH2bQcdj9SfSg== X-Received: by 2002:aa7:9989:0:b029:1f5:aa05:94af with SMTP id k9-20020aa799890000b02901f5aa0594afmr1914658pfh.34.1616450955648; Mon, 22 Mar 2021 15:09:15 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:8115:e5cc:747b:64de]) by smtp.gmail.com with ESMTPSA id v26sm14226293pff.195.2021.03.22.15.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 15:09:15 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Mar 2021 07:09:10 +0900 Message-Id: <20210322220910.3179457-1-hiroh@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: device_enumerator: Remove unnecessary rvalue references 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" There are std::unique_ptr rvalue reference arguments. They are intended to pass the ownership to the functions. In the case, it is right to let the argument be std::unique_ptr value and pass by std::move(). Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- include/libcamera/internal/device_enumerator.h | 2 +- include/libcamera/internal/device_enumerator_udev.h | 4 ++-- src/libcamera/device_enumerator.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.31.0.rc2.261.g7f71774620-goog diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h index a9850400..707cfe8f 100644 --- a/include/libcamera/internal/device_enumerator.h +++ b/include/libcamera/internal/device_enumerator.h @@ -49,7 +49,7 @@ public: protected: std::unique_ptr createDevice(const std::string &deviceNode); - void addDevice(std::unique_ptr &&media); + void addDevice(std::unique_ptr media); void removeDevice(const std::string &deviceNode); private: diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h index 6f45be0c..58e64a29 100644 --- a/include/libcamera/internal/device_enumerator_udev.h +++ b/include/libcamera/internal/device_enumerator_udev.h @@ -39,8 +39,8 @@ private: using DependencyMap = std::map>; struct MediaDeviceDeps { - MediaDeviceDeps(std::unique_ptr &&media, - DependencyMap &&deps) + MediaDeviceDeps(std::unique_ptr media, + DependencyMap deps) : media_(std::move(media)), deps_(std::move(deps)) { } diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index 647974b1..e6ecc360 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -246,7 +246,7 @@ std::unique_ptr DeviceEnumerator::createDevice(const std::string &d * This method shall be called after all members of the entities of the * media graph have been confirmed to be initialized. */ -void DeviceEnumerator::addDevice(std::unique_ptr &&media) +void DeviceEnumerator::addDevice(std::unique_ptr media) { LOG(DeviceEnumerator, Debug) << "Added device " << media->deviceNode() << ": " << media->driver();