Patch Detail
Show a patch.
GET /api/1.1/patches/26140/?format=api
{ "id": 26140, "url": "https://patchwork.libcamera.org/api/1.1/patches/26140/?format=api", "web_url": "https://patchwork.libcamera.org/patch/26140/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260212151238.3736234-5-laurent.pinchart@ideasonboard.com>", "date": "2026-02-12T15:12:38", "name": "[v2,4/4] libcamera: Standardize on 'const auto'", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cbf13ebcbbdaa240b844c87c73c761a89e8ce550", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/26140/mbox/", "series": [ { "id": 5787, "url": "https://patchwork.libcamera.org/api/1.1/series/5787/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5787", "date": "2026-02-12T15:12:34", "name": "libcamera: Clean up iterators", "version": 2, "mbox": "https://patchwork.libcamera.org/series/5787/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/26140/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/26140/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 74558BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Feb 2026 15:12:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ECBB3621DA;\n\tThu, 12 Feb 2026 16:12:47 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C83D621CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Feb 2026 16:12:45 +0100 (CET)", "from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 2950611EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Feb 2026 16:11:57 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mj4CzMAT\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770909117;\n\tbh=RWU4+ax/7Hd21GYl4lk7oADEjsAkvWNhBTefYE0iQCk=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=mj4CzMATnFMmwV6hBbcrG0EaL6yTRYkTGl64/m8+Lxm7qhyzYRx6zpdAP086Avptl\n\tE7PYSRFnUxK2w9W6XsvsomqP1RmbF4Sbyy7MOpbFKcLJhsijnY1k9MKcNEYYm+r07L\n\tqsusqs2THwPk33PZ693r4Q40tSIiR1zMe+AkpFkc=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v2 4/4] libcamera: Standardize on 'const auto'", "Date": "Thu, 12 Feb 2026 17:12:38 +0200", "Message-ID": "<20260212151238.3736234-5-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260212151238.3736234-1-laurent.pinchart@ideasonboard.com>", "References": "<20260212151238.3736234-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "'const auto' and 'auto const' are interchanggeable in C++. There are 446\noccurrences of the former in the code base, and 67 occurrences of the\nlatter. Standardize on the winner.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../guides/application-developer.rst | 2 +-\n include/libcamera/base/utils.h | 2 +-\n src/apps/common/stream_options.cpp | 4 ++--\n src/ipa/ipu3/ipu3.cpp | 8 +++----\n src/ipa/mali-c55/mali-c55.cpp | 8 +++----\n src/ipa/rkisp1/rkisp1.cpp | 8 +++----\n src/ipa/rpi/common/ipa_base.cpp | 4 ++--\n src/ipa/rpi/controller/controller.cpp | 6 ++---\n src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +-\n src/ipa/rpi/controller/rpi/lux.cpp | 2 +-\n src/ipa/rpi/pisp/pisp.cpp | 2 +-\n src/ipa/rpi/vc4/vc4.cpp | 2 +-\n src/ipa/simple/soft_simple.cpp | 8 +++----\n src/libcamera/delayed_controls.cpp | 4 ++--\n src/libcamera/media_device.cpp | 2 +-\n src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 +-\n .../pipeline/rpi/common/delayed_controls.cpp | 4 ++--\n .../pipeline/rpi/common/pipeline_base.cpp | 24 +++++++++----------\n .../pipeline/rpi/common/rpi_stream.cpp | 8 +++----\n src/libcamera/pipeline/rpi/pisp/pisp.cpp | 6 ++---\n src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +-\n src/libcamera/pipeline/virtual/virtual.cpp | 2 +-\n src/libcamera/stream.cpp | 4 ++--\n src/libcamera/v4l2_videodevice.cpp | 2 +-\n test/media_device/media_device_print_test.cpp | 10 ++++----\n test/v4l2_videodevice/buffer_cache.cpp | 2 +-\n 26 files changed, 65 insertions(+), 65 deletions(-)", "diff": "diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst\nindex 06c07d1e9449..918077af1d22 100644\n--- a/Documentation/guides/application-developer.rst\n+++ b/Documentation/guides/application-developer.rst\n@@ -82,7 +82,7 @@ cameras in the system:\n \n .. code:: cpp\n \n- for (auto const &camera : cm->cameras())\n+ for (const auto &camera : cm->cameras())\n std::cout << camera->id() << std::endl;\n \n Printing the camera id lists the machine-readable unique identifiers, so for\ndiff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\nindex 37f0d065f82f..7083b7ce9ce9 100644\n--- a/include/libcamera/base/utils.h\n+++ b/include/libcamera/base/utils.h\n@@ -340,7 +340,7 @@ public:\n \ttemplate<typename Period>\n \tdouble get() const\n \t{\n-\t\tauto const c = std::chrono::duration_cast<std::chrono::duration<double, Period>>(*this);\n+\t\tconst auto c = std::chrono::duration_cast<std::chrono::duration<double, Period>>(*this);\n \t\treturn c.count();\n \t}\n \ndiff --git a/src/apps/common/stream_options.cpp b/src/apps/common/stream_options.cpp\nindex 288f86530351..54e00737cb65 100644\n--- a/src/apps/common/stream_options.cpp\n+++ b/src/apps/common/stream_options.cpp\n@@ -48,7 +48,7 @@ std::vector<StreamRole> StreamKeyValueParser::roles(const OptionValue &values)\n \tconst std::vector<OptionValue> &streamParameters = values.toArray();\n \n \tstd::vector<StreamRole> roles;\n-\tfor (auto const &value : streamParameters) {\n+\tfor (const auto &value : streamParameters) {\n \t\t/* If a role is invalid default it to viewfinder. */\n \t\troles.push_back(parseRole(value.toKeyValues()).value_or(StreamRole::Viewfinder));\n \t}\n@@ -81,7 +81,7 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,\n \t}\n \n \tunsigned int i = 0;\n-\tfor (auto const &value : streamParameters) {\n+\tfor (const auto &value : streamParameters) {\n \t\tKeyValueParser::Options opts = value.toKeyValues();\n \t\tStreamConfiguration &cfg = config->at(i++);\n \ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 03d873f2c74f..92f5bd072134 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -493,7 +493,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \t/* Update the IPASessionConfiguration using the sensor settings. */\n \tupdateSessionConfiguration(sensorCtrls_);\n \n-\tfor (auto const &algo : algorithms()) {\n+\tfor (const auto &algo : algorithms()) {\n \t\tint ret = algo->configure(context_, configInfo);\n \t\tif (ret)\n \t\t\treturn ret;\n@@ -563,7 +563,7 @@ void IPAIPU3::computeParams(const uint32_t frame, const uint32_t bufferId)\n \n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n \n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->prepare(context_, frame, frameContext, params);\n \n \tparamsComputed.emit(frame);\n@@ -601,7 +601,7 @@ void IPAIPU3::processStats(const uint32_t frame,\n \n \tControlList metadata(controls::controls);\n \n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->process(context_, frame, frameContext, stats, metadata);\n \n \tsetControls(frame);\n@@ -629,7 +629,7 @@ void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls)\n {\n \tIPAFrameContext &frameContext = context_.frameContexts.alloc(frame);\n \n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->queueRequest(context_, frame, frameContext, controls);\n }\n \ndiff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp\nindex c626e246643b..fd5c9563d6c3 100644\n--- a/src/ipa/mali-c55/mali-c55.cpp\n+++ b/src/ipa/mali-c55/mali-c55.cpp\n@@ -285,7 +285,7 @@ int IPAMaliC55::configure(const IPAConfigInfo &ipaConfig, uint8_t bayerOrder,\n \t\t\t\t static_cast<BayerFormat::Order>(bayerOrder));\n \tupdateControls(info, ipaConfig.sensorControls, ipaControls);\n \n-\tfor (auto const &a : algorithms()) {\n+\tfor (const auto &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \n \t\tint ret = algo->configure(context_, info);\n@@ -324,7 +324,7 @@ void IPAMaliC55::queueRequest(const uint32_t request, const ControlList &control\n {\n \tIPAFrameContext &frameContext = context_.frameContexts.alloc(request);\n \n-\tfor (auto const &a : algorithms()) {\n+\tfor (const auto &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \n \t\talgo->queueRequest(context_, request, frameContext, controls);\n@@ -337,7 +337,7 @@ void IPAMaliC55::fillParams(unsigned int request,\n \tIPAFrameContext &frameContext = context_.frameContexts.get(request);\n \tMaliC55Params params(buffers_.at(bufferId).planes()[0]);\n \n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->prepare(context_, request, frameContext, ¶ms);\n \n \tparamsComputed.emit(request, params.bytesused());\n@@ -359,7 +359,7 @@ void IPAMaliC55::processStats(unsigned int request, unsigned int bufferId,\n \n \tControlList metadata(controls::controls);\n \n-\tfor (auto const &a : algorithms()) {\n+\tfor (const auto &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \n \t\talgo->process(context_, request, frameContext, stats, metadata);\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex fbcc39103d4b..373a343bddd0 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -280,7 +280,7 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n \t\t\treturn format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n \t\t});\n \n-\tfor (auto const &a : algorithms()) {\n+\tfor (const auto &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \n \t\t/* Disable algorithms that don't support raw formats. */\n@@ -331,7 +331,7 @@ void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls)\n \tIPAFrameContext &frameContext = context_.frameContexts.alloc(frame);\n \tcontext_.debugMetadata.enableByControl(controls);\n \n-\tfor (auto const &a : algorithms()) {\n+\tfor (const auto &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \t\tif (algo->disabled_)\n \t\t\tcontinue;\n@@ -346,7 +346,7 @@ void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId)\n \tRkISP1Params params(context_.configuration.paramFormat,\n \t\t\t mappedBuffers_.at(bufferId).planes()[0]);\n \n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->prepare(context_, frame, frameContext, ¶ms);\n \n \tparamsComputed.emit(frame, params.bytesused());\n@@ -373,7 +373,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n \n \tControlList metadata(controls::controls);\n \n-\tfor (auto const &a : algorithms()) {\n+\tfor (const auto &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \t\tif (algo->disabled_)\n \t\t\tcontinue;\ndiff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\nindex 7072b38c765e..17f6850f247e 100644\n--- a/src/ipa/rpi/common/ipa_base.cpp\n+++ b/src/ipa/rpi/common/ipa_base.cpp\n@@ -924,7 +924,7 @@ void IpaBase::applyControls(const ControlList &controls)\n \t\t} while (false);\n \n \t/* Iterate over controls */\n-\tfor (auto const &ctrl : controls) {\n+\tfor (const auto &ctrl : controls) {\n \t\tLOG(IPARPI, Debug) << \"Request ctrl: \"\n \t\t\t\t << controls::controls.at(ctrl.first)->name()\n \t\t\t\t << \" = \" << ctrl.second.toString();\n@@ -1627,7 +1627,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)\n \tconst HdrStatus &hdrStatus = agcStatus ? agcStatus->hdr : hdrStatus_;\n \tif (!hdrStatus.mode.empty() && hdrStatus.mode != \"Off\") {\n \t\tint32_t hdrMode = controls::HdrModeOff;\n-\t\tfor (auto const &[mode, name] : HdrModeTable) {\n+\t\tfor (const auto &[mode, name] : HdrModeTable) {\n \t\t\tif (hdrStatus.mode == name) {\n \t\t\t\thdrMode = mode;\n \t\t\t\tbreak;\ndiff --git a/src/ipa/rpi/controller/controller.cpp b/src/ipa/rpi/controller/controller.cpp\nindex 88de6f3655a8..138f6cb29141 100644\n--- a/src/ipa/rpi/controller/controller.cpp\n+++ b/src/ipa/rpi/controller/controller.cpp\n@@ -114,7 +114,7 @@ int Controller::read(char const *filename)\n \t\t\t<< \"This format of the tuning file will be deprecated soon!\"\n \t\t\t<< \" Please use the convert_tuning.py utility to update to version 2.0.\";\n \n-\t\tfor (auto const &[key, value] : root->asDict()) {\n+\t\tfor (const auto &[key, value] : root->asDict()) {\n \t\t\tint ret = createAlgorithm(key, value);\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n@@ -127,8 +127,8 @@ int Controller::read(char const *filename)\n \t\t\treturn -EINVAL;\n \t\t}\n \n-\t\tfor (auto const &rootAlgo : (*root)[\"algorithms\"].asList())\n-\t\t\tfor (auto const &[key, value] : rootAlgo.asDict()) {\n+\t\tfor (const auto &rootAlgo : (*root)[\"algorithms\"].asList())\n+\t\t\tfor (const auto &[key, value] : rootAlgo.asDict()) {\n \t\t\t\tint ret = createAlgorithm(key, value);\n \t\t\t\tif (ret)\n \t\t\t\t\treturn ret;\ndiff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\nindex 154551dfacc2..010de81a0e35 100644\n--- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n+++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n@@ -298,7 +298,7 @@ int AgcChannel::read(const libcamera::YamlObject ¶ms,\n \t\treturn ret;\n \n \tconst Size &size = hardwareConfig.agcZoneWeights;\n-\tfor (auto const &modes : config_.meteringModes) {\n+\tfor (const auto &modes : config_.meteringModes) {\n \t\tif (modes.second.weights.size() != size.width * size.height) {\n \t\t\tLOG(RPiAgc, Error) << \"AgcMeteringMode: Incorrect number of weights\";\n \t\t\treturn -EINVAL;\ndiff --git a/src/ipa/rpi/controller/rpi/lux.cpp b/src/ipa/rpi/controller/rpi/lux.cpp\nindex 7dab27cc0a90..efc2c511dbdc 100644\n--- a/src/ipa/rpi/controller/rpi/lux.cpp\n+++ b/src/ipa/rpi/controller/rpi/lux.cpp\n@@ -90,7 +90,7 @@ void Lux::process(StatisticsPtr &stats, Metadata *imageMetadata)\n \t\t * is a better choice than the Y-histogram, for example, because it's invariant\n \t\t * to the metering mode (and cheaper to evaluate).\n \t\t */\n-\t\tauto const &fullImageStats = stats->agcRegions.getFloating(0);\n+\t\tconst auto &fullImageStats = stats->agcRegions.getFloating(0);\n \t\tdouble currentY = static_cast<double>(fullImageStats.val.ySum) / fullImageStats.counted;\n \n \t\tdouble currentGain = deviceStatus.analogueGain;\ndiff --git a/src/ipa/rpi/pisp/pisp.cpp b/src/ipa/rpi/pisp/pisp.cpp\nindex ec7593ffc940..63935985ce5b 100644\n--- a/src/ipa/rpi/pisp/pisp.cpp\n+++ b/src/ipa/rpi/pisp/pisp.cpp\n@@ -553,7 +553,7 @@ RPiController::StatisticsPtr IpaPiSP::platformProcessStats(Span<uint8_t> mem)\n \n void IpaPiSP::handleControls(const ControlList &controls)\n {\n-\tfor (auto const &ctrl : controls) {\n+\tfor (const auto &ctrl : controls) {\n \t\tswitch (ctrl.first) {\n \t\tcase controls::HDR_MODE:\n \t\tcase controls::AE_METERING_MODE:\ndiff --git a/src/ipa/rpi/vc4/vc4.cpp b/src/ipa/rpi/vc4/vc4.cpp\nindex 2b205b2861bd..b6ca44e7a0a0 100644\n--- a/src/ipa/rpi/vc4/vc4.cpp\n+++ b/src/ipa/rpi/vc4/vc4.cpp\n@@ -300,7 +300,7 @@ void IpaVc4::handleControls(const ControlList &controls)\n \t\t{ controls::draft::NoiseReductionModeZSL, RPiController::DenoiseMode::ColourHighQuality },\n \t};\n \n-\tfor (auto const &ctrl : controls) {\n+\tfor (const auto &ctrl : controls) {\n \t\tswitch (ctrl.first) {\n \t\tcase controls::draft::NOISE_REDUCTION_MODE: {\n \t\t\tRPiController::DenoiseAlgorithm *sdn = dynamic_cast<RPiController::DenoiseAlgorithm *>(\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex 6bef597c8ace..c35277cfe06e 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -249,7 +249,7 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo)\n \t\tcontext_.configuration.agc.againMinStep = 1.0;\n \t}\n \n-\tfor (auto const &algo : algorithms()) {\n+\tfor (const auto &algo : algorithms()) {\n \t\tint ret = algo->configure(context_, configInfo);\n \t\tif (ret)\n \t\t\treturn ret;\n@@ -279,7 +279,7 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n {\n \tIPAFrameContext &frameContext = context_.frameContexts.alloc(frame);\n \n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->queueRequest(context_, frame, frameContext, controls);\n }\n \n@@ -288,7 +288,7 @@ void IPASoftSimple::computeParams(const uint32_t frame)\n \tcontext_.activeState.combinedMatrix = Matrix<float, 3, 3>::identity();\n \n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->prepare(context_, frame, frameContext, params_);\n \tparams_->combinedMatrix = context_.activeState.combinedMatrix;\n \n@@ -307,7 +307,7 @@ void IPASoftSimple::processStats(const uint32_t frame,\n \tframeContext.sensor.gain = camHelper_ ? camHelper_->gain(again) : again;\n \n \tControlList metadata(controls::controls);\n-\tfor (auto const &algo : algorithms())\n+\tfor (const auto &algo : algorithms())\n \t\talgo->process(context_, frame, frameContext, stats_, metadata);\n \tmetadataReady.emit(frame, metadata);\n \ndiff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex 94d0a575b01b..5b3ced4e711d 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -81,7 +81,7 @@ DelayedControls::DelayedControls(V4L2Device *device,\n \t * Create a map of control ids to delays for controls exposed by the\n \t * device.\n \t */\n-\tfor (auto const ¶m : controlParams) {\n+\tfor (const auto ¶m : controlParams) {\n \t\tauto it = controls.find(param.first);\n \t\tif (it == controls.end()) {\n \t\t\tLOG(DelayedControls, Error)\n@@ -120,7 +120,7 @@ void DelayedControls::reset()\n \n \t/* Retrieve control as reported by the device. */\n \tstd::vector<uint32_t> ids;\n-\tfor (auto const ¶m : controlParams_)\n+\tfor (const auto ¶m : controlParams_)\n \t\tids.push_back(param.first->id());\n \n \tControlList controls = device_->getControls(ids);\ndiff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\nindex 8c82a2b1488b..3f974eaabd67 100644\n--- a/src/libcamera/media_device.cpp\n+++ b/src/libcamera/media_device.cpp\n@@ -589,7 +589,7 @@ bool MediaDevice::addObject(MediaObject *object)\n */\n void MediaDevice::clear()\n {\n-\tfor (auto const &o : objects_)\n+\tfor (const auto &o : objects_)\n \t\tdelete o.second;\n \n \tobjects_.clear();\ndiff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\nindex 77f251416f71..c209b0b070b1 100644\n--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n@@ -318,7 +318,7 @@ void MaliC55CameraData::updateControls(const ControlInfoMap &ipaControls)\n \t\tControlInfo(ispMinCrop, sensorInfo.analogCrop,\n \t\t\t sensorInfo.analogCrop);\n \n-\tfor (auto const &c : ipaControls)\n+\tfor (const auto &c : ipaControls)\n \t\tcontrols.emplace(c.first, c.second);\n \n \tcontrolInfo_ = ControlInfoMap(std::move(controls), controls::controls);\ndiff --git a/src/libcamera/pipeline/rpi/common/delayed_controls.cpp b/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\nindex ad50a7c8bb08..19c719460349 100644\n--- a/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\n+++ b/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\n@@ -85,7 +85,7 @@ DelayedControls::DelayedControls(V4L2Device *device,\n \t * Create a map of control ids to delays for controls exposed by the\n \t * device.\n \t */\n-\tfor (auto const ¶m : controlParams) {\n+\tfor (const auto ¶m : controlParams) {\n \t\tauto it = controls.find(param.first);\n \t\tif (it == controls.end()) {\n \t\t\tLOG(RPiDelayedControls, Error)\n@@ -125,7 +125,7 @@ void DelayedControls::reset(unsigned int cookie)\n \n \t/* Retrieve control as reported by the device. */\n \tstd::vector<uint32_t> ids;\n-\tfor (auto const ¶m : controlParams_)\n+\tfor (const auto ¶m : controlParams_)\n \t\tids.push_back(param.first->id());\n \n \tControlList controls = device_->getControls(ids);\ndiff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex de43603ddf69..c507b44b27d0 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -508,7 +508,7 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)\n \n \t/* Start by freeing all buffers and reset the stream states. */\n \tdata->freeBuffers();\n-\tfor (auto const stream : data->streams_)\n+\tfor (const auto stream : data->streams_)\n \t\tstream->clearFlags(StreamFlag::External);\n \n \t/*\n@@ -561,7 +561,7 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)\n \n \t/* Update the controls that the Raspberry Pi IPA can handle. */\n \tControlInfoMap::Map ctrlMap;\n-\tfor (auto const &c : result.controlInfo)\n+\tfor (const auto &c : result.controlInfo)\n \t\tctrlMap.emplace(c.first, c.second);\n \n \tconst auto cropParamsIt = data->cropParams_.find(0);\n@@ -663,7 +663,7 @@ int PipelineHandlerBase::start(Camera *camera, const ControlList *controls)\n \tdata->startupFrameCount_ = result.startupFrameCount;\n \tdata->invalidFrameCount_ = result.invalidFrameCount;\n \n-\tfor (auto const stream : data->streams_)\n+\tfor (const auto stream : data->streams_)\n \t\tstream->resetBuffers();\n \n \tif (!data->buffersAllocated_) {\n@@ -701,7 +701,7 @@ int PipelineHandlerBase::start(Camera *camera, const ControlList *controls)\n \tdata->platformStart();\n \n \t/* Start all streams. */\n-\tfor (auto const stream : data->streams_) {\n+\tfor (const auto stream : data->streams_) {\n \t\tret = stream->dev()->streamOn();\n \t\tif (ret) {\n \t\t\tstop(camera);\n@@ -719,7 +719,7 @@ void PipelineHandlerBase::stopDevice(Camera *camera)\n \tdata->state_ = CameraData::State::Stopped;\n \tdata->platformStop();\n \n-\tfor (auto const stream : data->streams_) {\n+\tfor (const auto stream : data->streams_) {\n \t\tstream->dev()->streamOff();\n \t\tstream->dev()->releaseBuffers();\n \t}\n@@ -801,7 +801,7 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n \t\treturn -EINVAL;\n \n \t/* Populate the map of sensor supported formats and sizes. */\n-\tfor (auto const mbusCode : data->sensor_->mbusCodes())\n+\tfor (const auto mbusCode : data->sensor_->mbusCodes())\n \t\tdata->sensorFormats_.emplace(mbusCode,\n \t\t\t\t\t data->sensor_->sizes(mbusCode));\n \n@@ -886,7 +886,7 @@ void PipelineHandlerBase::mapBuffers(Camera *camera, const BufferMap &buffers, u\n \t * This will allow us to identify buffers passed between the pipeline\n \t * handler and the IPA.\n \t */\n-\tfor (auto const &[id, buffer] : buffers) {\n+\tfor (const auto &[id, buffer] : buffers) {\n \t\tSpan<const FrameBuffer::Plane> planes = buffer.buffer->planes();\n \n \t\tbufferIds.emplace_back(mask | id,\n@@ -902,7 +902,7 @@ int PipelineHandlerBase::queueAllBuffers(Camera *camera)\n \tCameraData *data = cameraData(camera);\n \tint ret;\n \n-\tfor (auto const stream : data->streams_) {\n+\tfor (const auto stream : data->streams_) {\n \t\tret = stream->dev()->importBuffers(VIDEO_MAX_FRAME);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n@@ -987,7 +987,7 @@ void CameraData::freeBuffers()\n \t\tbufferIds_.clear();\n \t}\n \n-\tfor (auto const stream : streams_)\n+\tfor (const auto stream : streams_)\n \t\tstream->releaseBuffers();\n \n \tplatformFreeBuffers();\n@@ -1322,7 +1322,7 @@ void CameraData::applyScalerCrop(const ControlList &controls)\n \t\t\tscalerCrops.push_back(*scalerCropCore);\n \t}\n \n-\tfor (auto const &[i, scalerCrop] : utils::enumerate(scalerCrops)) {\n+\tfor (const auto &[i, scalerCrop] : utils::enumerate(scalerCrops)) {\n \t\tRectangle nativeCrop = scalerCrop;\n \n \t\tif (!nativeCrop.width || !nativeCrop.height)\n@@ -1364,7 +1364,7 @@ void CameraData::cameraTimeout()\n \t * stop all devices streaming, and return any outstanding requests as\n \t * incomplete and cancelled.\n \t */\n-\tfor (auto const stream : streams_)\n+\tfor (const auto stream : streams_)\n \t\tstream->dev()->streamOff();\n \n \tclearIncompleteRequests();\n@@ -1504,7 +1504,7 @@ void CameraData::fillRequestMetadata(const ControlList &bufferControls, Request\n \tif (cropParams_.size()) {\n \t\tstd::vector<Rectangle> crops;\n \n-\t\tfor (auto const &[k, v] : cropParams_)\n+\t\tfor (const auto &[k, v] : cropParams_)\n \t\t\tcrops.push_back(scaleIspCrop(v.ispCrop));\n \n \t\trequest->_d()->metadata().set(controls::ScalerCrop, crops[0]);\ndiff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\nindex f420400dfe18..db452a15c988 100644\n--- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n+++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n@@ -68,13 +68,13 @@ void Stream::resetBuffers()\n {\n \t/* Add all internal buffers to the queue of usable buffers. */\n \tavailableBuffers_ = {};\n-\tfor (auto const &buffer : internalBuffers_)\n+\tfor (const auto &buffer : internalBuffers_)\n \t\tavailableBuffers_.push(buffer.get());\n }\n \n void Stream::setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n {\n-\tfor (auto const &buffer : *buffers)\n+\tfor (const auto &buffer : *buffers)\n \t\tbufferEmplace(++id_, buffer.get());\n }\n \n@@ -90,7 +90,7 @@ unsigned int Stream::getBufferId(FrameBuffer *buffer) const\n \n \t/* Find the buffer in the map, and return the buffer id. */\n \tauto it = std::find_if(bufferMap_.begin(), bufferMap_.end(),\n-\t\t\t [&buffer](auto const &p) { return p.second.buffer == buffer; });\n+\t\t\t [&buffer](const auto &p) { return p.second.buffer == buffer; });\n \n \tif (it == bufferMap_.end())\n \t\treturn 0;\n@@ -201,7 +201,7 @@ void Stream::returnBuffer(FrameBuffer *buffer)\n \n const BufferObject &Stream::getBuffer(unsigned int id)\n {\n-\tauto const &it = bufferMap_.find(id);\n+\tconst auto &it = bufferMap_.find(id);\n \tif (it == bufferMap_.end())\n \t\treturn errorBufferObject;\n \ndiff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\nindex 7bcba32b9b58..dff73a79bb3f 100644\n--- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n+++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n@@ -972,7 +972,7 @@ int PipelineHandlerPiSP::allocateBuffers(Camera *camera)\n \t}\n \n \t/* Decide how many internal buffers to allocate. */\n-\tfor (auto const stream : data->streams_) {\n+\tfor (const auto stream : data->streams_) {\n \t\tunsigned int numBuffers;\n \t\t/*\n \t\t * For CFE, allocate a minimum of 4 buffers as we want\n@@ -1036,12 +1036,12 @@ int PipelineHandlerPiSP::allocateBuffers(Camera *camera)\n \tpisp_image_format_config tdn;\n \tdata->be_->GetTdnOutputFormat(tdn);\n \tunsigned int size = tdn.stride * tdn.height;\n-\tfor (auto const &buffer : data->isp_[Isp::TdnOutput].getBuffers()) {\n+\tfor (const auto &buffer : data->isp_[Isp::TdnOutput].getBuffers()) {\n \t\tFrameBuffer *b = buffer.second.buffer;\n \t\tb->_d()->metadata().planes()[0].bytesused = size;\n \t\tdata->tdnBuffers_.push_back(b);\n \t}\n-\tfor (auto const &buffer : data->isp_[Isp::StitchOutput].getBuffers()) {\n+\tfor (const auto &buffer : data->isp_[Isp::StitchOutput].getBuffers()) {\n \t\tFrameBuffer *b = buffer.second.buffer;\n \t\tb->_d()->metadata().planes()[0].bytesused = size;\n \t\tdata->stitchBuffers_.push_back(b);\ndiff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex 8a80439e9082..b734889dd016 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -233,7 +233,7 @@ int PipelineHandlerVc4::allocateBuffers(Camera *camera)\n \t}\n \n \t/* Decide how many internal buffers to allocate. */\n-\tfor (auto const stream : data->streams_) {\n+\tfor (const auto stream : data->streams_) {\n \t\tunsigned int numBuffers;\n \t\t/*\n \t\t * For Unicam, allocate a minimum number of buffers for internal\ndiff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp\nindex 40c35264c568..efd800ebe3d6 100644\n--- a/src/libcamera/pipeline/virtual/virtual.cpp\n+++ b/src/libcamera/pipeline/virtual/virtual.cpp\n@@ -136,7 +136,7 @@ VirtualCameraData::VirtualCameraData(PipelineHandler *pipe,\n \n void VirtualCameraData::processRequest(Request *request)\n {\n-\tfor (auto const &[stream, buffer] : request->buffers()) {\n+\tfor (const auto &[stream, buffer] : request->buffers()) {\n \t\tbool found = false;\n \t\t/* map buffer and fill test patterns */\n \t\tfor (auto &streamConfig : streamConfigs_) {\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 8df70dbfd10b..be0c80cbcfc2 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -194,7 +194,7 @@ std::vector<Size> StreamFormats::sizes(const PixelFormat &pixelformat) const\n \tstd::vector<Size> sizes;\n \n \t/* Make sure pixel format exists. */\n-\tauto const &it = formats_.find(pixelformat);\n+\tconst auto &it = formats_.find(pixelformat);\n \tif (it == formats_.end())\n \t\treturn {};\n \n@@ -243,7 +243,7 @@ std::vector<Size> StreamFormats::sizes(const PixelFormat &pixelformat) const\n */\n SizeRange StreamFormats::range(const PixelFormat &pixelformat) const\n {\n-\tauto const it = formats_.find(pixelformat);\n+\tconst auto it = formats_.find(pixelformat);\n \tif (it == formats_.end())\n \t\treturn {};\n \ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 61a4551c63c5..d877df29ee6e 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -206,7 +206,7 @@ V4L2BufferCache::~V4L2BufferCache()\n */\n bool V4L2BufferCache::isEmpty() const\n {\n-\tfor (auto const &entry : cache_) {\n+\tfor (const auto &entry : cache_) {\n \t\tif (!entry.free_)\n \t\t\treturn false;\n \t}\ndiff --git a/test/media_device/media_device_print_test.cpp b/test/media_device/media_device_print_test.cpp\nindex 63aeed48fff6..d4dc1f515069 100644\n--- a/test/media_device/media_device_print_test.cpp\n+++ b/test/media_device/media_device_print_test.cpp\n@@ -66,15 +66,15 @@ void MediaDevicePrintTest::printMediaGraph(const MediaDevice &media, ostream &os\n {\n \tos << \"\\n\" << media.driver() << \" - \" << media.deviceNode() << \"\\n\\n\";\n \n-\tfor (auto const &entity : media.entities()) {\n+\tfor (const auto &entity : media.entities()) {\n \t\tos << \"\\\"\" << entity->name() << \"\\\"\\n\";\n \n-\t\tfor (auto const &sink : entity->pads()) {\n+\t\tfor (const auto &sink : entity->pads()) {\n \t\t\tif (!(sink->flags() & MEDIA_PAD_FL_SINK))\n \t\t\t\tcontinue;\n \n \t\t\tos << \" [\" << sink->index() << \"]\" << \": Sink\\n\";\n-\t\t\tfor (auto const &link : sink->links()) {\n+\t\t\tfor (const auto &link : sink->links()) {\n \t\t\t\tos << \"\\t\";\n \t\t\t\tprintNode(sink, os);\n \t\t\t\tos << \" <- \";\n@@ -84,12 +84,12 @@ void MediaDevicePrintTest::printMediaGraph(const MediaDevice &media, ostream &os\n \t\t\tos << \"\\n\";\n \t\t}\n \n-\t\tfor (auto const &source : entity->pads()) {\n+\t\tfor (const auto &source : entity->pads()) {\n \t\t\tif (!(source->flags() & MEDIA_PAD_FL_SOURCE))\n \t\t\t\tcontinue;\n \n \t\t\tos << \" [\" << source->index() << \"]\" << \": Source\\n\";\n-\t\t\tfor (auto const &link : source->links()) {\n+\t\t\tfor (const auto &link : source->links()) {\n \t\t\t\tos << \"\\t\";\n \t\t\t\tprintNode(source, os);\n \t\t\t\tos << \" -> \";\ndiff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp\nindex 5a9aa2199c50..613e0d7ce9d2 100644\n--- a/test/v4l2_videodevice/buffer_cache.cpp\n+++ b/test/v4l2_videodevice/buffer_cache.cpp\n@@ -133,7 +133,7 @@ public:\n \t\tif (!cache.isEmpty())\n \t\t\treturn TestFail;\n \n-\t\tfor (auto const &buffer : buffers) {\n+\t\tfor (const auto &buffer : buffers) {\n \t\t\tFrameBuffer &b = *buffer.get();\n \t\t\tcache.get(b);\n \t\t}\n", "prefixes": [ "v2", "4/4" ] }