[{"id":196,"web_url":"https://patchwork.libcamera.org/comment/196/","msgid":"<20190103212528.GH22790@bigcity.dyn.berto.se>","date":"2019-01-03T21:25:28","subject":"Re: [libcamera-devel] [PATCH 6/9] libcamera: device_enumerator:\n\tConstify argument to search function","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2019-01-03 03:31:07 +0200, Laurent Pinchart wrote:\n> The DeviceEnumerator::search() function doesn't need to modify its\n> DeviceMatch argument, make it const.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/device_enumerator.cpp       | 2 +-\n>  src/libcamera/include/device_enumerator.h | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\n> index ecd51bc1d108..a301420f39e1 100644\n> --- a/src/libcamera/device_enumerator.cpp\n> +++ b/src/libcamera/device_enumerator.cpp\n> @@ -215,7 +215,7 @@ int DeviceEnumerator::addDevice(const std::string &devnode)\n>   *\n>   * \\return pointer to the matching MediaDevice, nullptr if no match is found\n>   */\n> -MediaDevice *DeviceEnumerator::search(DeviceMatch &dm) const\n> +MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const\n>  {\n>  \tfor (MediaDevice *dev : devices_) {\n>  \t\tif (dev->busy())\n> diff --git a/src/libcamera/include/device_enumerator.h b/src/libcamera/include/device_enumerator.h\n> index 0d104667323b..29737da7a225 100644\n> --- a/src/libcamera/include/device_enumerator.h\n> +++ b/src/libcamera/include/device_enumerator.h\n> @@ -41,7 +41,7 @@ public:\n>  \tvirtual int init() = 0;\n>  \tvirtual int enumerate() = 0;\n>  \n> -\tMediaDevice *search(DeviceMatch &dm) const;\n> +\tMediaDevice *search(const DeviceMatch &dm) const;\n>  \n>  protected:\n>  \tint addDevice(const std::string &devnode);\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 01BDE60B21\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Jan 2019 22:25:40 +0100 (CET)","by mail-lj1-x241.google.com with SMTP id q2-v6so30863481lji.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 03 Jan 2019 13:25:39 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\t10sm10726926lff.62.2019.01.03.13.25.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 03 Jan 2019 13:25:34 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=76jXBPIq3pKvgcXBQZkWl8CsO3qP1QD4WUN5yNdND7A=;\n\tb=NBKepZDzVIRGjWXAHo5jy4yOVEn/M+FgCjZZqOoNvk7QrdMESbEE7/lE7yaiNZgq6y\n\tXscmKxEqpwc3hkvvh9Box7IYOAS245Xooo0JGAoYpgUgYMCb+A0Gai1TaNQIPLXT7b10\n\tErRz6r+BqAkR2wXxiU2EsD5dO6L/C5GdO4Wcj2vF3zxCgVhrAr6rHObuFXZeRSoPg7b8\n\tRqPbfLBgluTBZJV55R6GMIF2POeg2vua25htPr51b7+cxpj9EopOl7YymM/blswzKwc+\n\tcwui3TAs3vf5zn6XE9XYfv7rBpmGb/VPyGKqxCLO73FYDlBhCqOmCwybT1b8grPrUFP1\n\tNWqg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=76jXBPIq3pKvgcXBQZkWl8CsO3qP1QD4WUN5yNdND7A=;\n\tb=nfBNWoo7+3+HXvqmk19SuOGDCQ87OCLR53aOksxO7iZE9lx47JqM4jyG6isnPtLjPF\n\ttMcH3a1KV05C/3Q4Op4T/F3n64CGHW2KIsKtBtVU2ZRiZJ76lwQE+UXAnRcuy3ZQmn+0\n\tV1fbgCKemZkQEH0s25jfkidqQhiFl84oJ511nZ29kDDLnKaPyjdeRsQpeBed6mrRXq4C\n\tOX/LDf2I85NnwaPzTqXC2RmCz+zN5e8vOWGJ4dyvgtbXqBFnz1tmQ9PedwclUlgkFI7x\n\td4INtamjSkVJNtjRz1cChqsqQd9pAHhc/0ExvVbNQqnh4p4YYKIBYfidTxRRPQaM/uHM\n\tdUBQ==","X-Gm-Message-State":"AJcUukfUonVdlvpVjsNd3scxiKrZOQS0CKq+9TQvslgbmREj0kIv/jdQ\n\twXdP/UuxTkQyb36dtp9kbiUtug==","X-Google-Smtp-Source":"ALg8bN4pr7XZi5PRU6rpf4QEyS9v2gSBdtjNObjCQBXs8pL0d/8/YT+t6/9bPuXcMR548bqSDj3gCg==","X-Received":"by 2002:a2e:8446:: with SMTP id\n\tu6-v6mr30906835ljh.74.1546550739324; \n\tThu, 03 Jan 2019 13:25:39 -0800 (PST)","Date":"Thu, 3 Jan 2019 22:25:28 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190103212528.GH22790@bigcity.dyn.berto.se>","References":"<20190103013110.6849-1-laurent.pinchart@ideasonboard.com>\n\t<20190103013110.6849-6-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190103013110.6849-6-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 6/9] libcamera: device_enumerator:\n\tConstify argument to search function","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Thu, 03 Jan 2019 21:25:40 -0000"}}]