From patchwork Thu Jan 3 01:31:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 140 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0320D60B39 for ; Thu, 3 Jan 2019 02:30:15 +0100 (CET) Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 873BA573 for ; Thu, 3 Jan 2019 02:30:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546479014; bh=7ciHPqbwUpPkROtxXUA2DqAc9svbXM2Z8aWCLFd6h4c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Skv9S2E1ePh5zK/HFSmi0jNF2ILXjkc9cUu/bGSkD0prUtz0nOpDXzmlkXBPr90ex IWZNVlO4+ry4Ukqe9ZnGTO+RYU/JSkbLn1auUURiHEWhXH/HEiK3lzCrqC1y8LZ9On PeUY0zlWFUluNRYuhWDVH8u949hVsNwEDZXN/Ttc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 3 Jan 2019 03:31:07 +0200 Message-Id: <20190103013110.6849-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190103013110.6849-1-laurent.pinchart@ideasonboard.com> References: <20190103013110.6849-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/9] libcamera: device_enumerator: Constify argument to search function X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 01:30:15 -0000 The DeviceEnumerator::search() function doesn't need to modify its DeviceMatch argument, make it const. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/device_enumerator.cpp | 2 +- src/libcamera/include/device_enumerator.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index ecd51bc1d108..a301420f39e1 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -215,7 +215,7 @@ int DeviceEnumerator::addDevice(const std::string &devnode) * * \return pointer to the matching MediaDevice, nullptr if no match is found */ -MediaDevice *DeviceEnumerator::search(DeviceMatch &dm) const +MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const { for (MediaDevice *dev : devices_) { if (dev->busy()) diff --git a/src/libcamera/include/device_enumerator.h b/src/libcamera/include/device_enumerator.h index 0d104667323b..29737da7a225 100644 --- a/src/libcamera/include/device_enumerator.h +++ b/src/libcamera/include/device_enumerator.h @@ -41,7 +41,7 @@ public: virtual int init() = 0; virtual int enumerate() = 0; - MediaDevice *search(DeviceMatch &dm) const; + MediaDevice *search(const DeviceMatch &dm) const; protected: int addDevice(const std::string &devnode);