Show a patch.

GET /api/patches/23459/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 23459,
    "url": "https://patchwork.libcamera.org/api/patches/23459/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23459/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20250603111434.751188-1-barnabas.pocze@ideasonboard.com>",
    "date": "2025-06-03T11:14:34",
    "name": "[v1] treewide: Remove top-level `const` from return types",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8bc68bbed86dc3c11cb20971f1118e54779ae779",
    "submitter": {
        "id": 216,
        "url": "https://patchwork.libcamera.org/api/people/216/?format=api",
        "name": "Barnabás Pőcze",
        "email": "barnabas.pocze@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23459/mbox/",
    "series": [
        {
            "id": 5202,
            "url": "https://patchwork.libcamera.org/api/series/5202/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5202",
            "date": "2025-06-03T11:14:34",
            "name": "[v1] treewide: Remove top-level `const` from return types",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5202/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23459/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23459/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 3A44FC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 Jun 2025 11:14:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2A5768DBB;\n\tTue,  3 Jun 2025 13:14:40 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3CE64614D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 Jun 2025 13:14:39 +0200 (CEST)",
            "from pb-laptop.local (185.182.214.140.nat.pool.zt.hu\n\t[185.182.214.140])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E705F496\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 Jun 2025 13:14:35 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NjL8aDlK\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1748949277;\n\tbh=TYdadFe+tUysgQyTiabJX3j+82ED7df/VTYDaYEfGz4=;\n\th=From:To:Subject:Date:From;\n\tb=NjL8aDlKar5+cOSZ7FY36thZAWo9K5GfS4m7Lpk8YytsmyVE8Y6phWZ3NJQRuknZK\n\tHmSP4sP7wIwSmqGyc0HlPS5T9E7yReki04BwvyBCnx7XDVM7QWYtCDLFDuBQW7sx/B\n\thPxCI6GWhFbOFQXwJQUc3SkTUOohzVoWxlAV/rFM=",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v1] treewide: Remove top-level `const` from return types",
        "Date": "Tue,  3 Jun 2025 13:14:34 +0200",
        "Message-ID": "<20250603111434.751188-1-barnabas.pocze@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.49.0",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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": "Top-level `const` qualifiers are not useful, so avoid them. This is done\neither by simply removing the top-level `const`, or making the function\nreturn a reference to const where that is appropriate.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/base/log.h                  | 2 +-\n include/libcamera/geometry.h                  | 6 +++---\n include/libcamera/internal/matrix.h           | 2 +-\n include/libcamera/internal/v4l2_subdevice.h   | 2 +-\n include/libcamera/internal/v4l2_videodevice.h | 2 +-\n src/apps/cam/drm.h                            | 4 ++--\n src/ipa/libipa/histogram.h                    | 2 +-\n src/libcamera/geometry.cpp                    | 6 +++---\n src/libcamera/pipeline/ipu3/ipu3.cpp          | 2 +-\n src/libcamera/pipeline/mali-c55/mali-c55.cpp  | 8 ++++----\n src/libcamera/v4l2_subdevice.cpp              | 2 +-\n src/libcamera/v4l2_videodevice.cpp            | 2 +-\n 12 files changed, 20 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\nindex 8af74b59d..5a232a650 100644\n--- a/include/libcamera/base/log.h\n+++ b/include/libcamera/base/log.h\n@@ -75,7 +75,7 @@ public:\n \tconst LogCategory &category() const { return category_; }\n \tconst std::string &fileInfo() const { return fileInfo_; }\n \tconst std::string &prefix() const { return prefix_; }\n-\tconst std::string msg() const { return msgStream_.str(); }\n+\tstd::string msg() const { return msgStream_.str(); }\n \n private:\n \tLIBCAMERA_DISABLE_COPY_AND_MOVE(LogMessage)\ndiff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex f322e3d5b..d9378efec 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -31,7 +31,7 @@ public:\n \tint x;\n \tint y;\n \n-\tconst std::string toString() const;\n+\tstd::string toString() const;\n \n \tconstexpr Point operator-() const\n \t{\n@@ -64,7 +64,7 @@ public:\n \tunsigned int height;\n \n \tbool isNull() const { return !width && !height; }\n-\tconst std::string toString() const;\n+\tstd::string toString() const;\n \n \tSize &alignDownTo(unsigned int hAlignment, unsigned int vAlignment)\n \t{\n@@ -275,7 +275,7 @@ public:\n \tunsigned int height;\n \n \tbool isNull() const { return !width && !height; }\n-\tconst std::string toString() const;\n+\tstd::string toString() const;\n \n \tPoint center() const;\n \ndiff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h\nindex 47513b995..1842389f2 100644\n--- a/include/libcamera/internal/matrix.h\n+++ b/include/libcamera/internal/matrix.h\n@@ -56,7 +56,7 @@ public:\n \n \t~Matrix() = default;\n \n-\tconst std::string toString() const\n+\tstd::string toString() const\n \t{\n \t\tstd::stringstream out;\n \ndiff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\nindex fa2a4a21e..c1cde1df2 100644\n--- a/include/libcamera/internal/v4l2_subdevice.h\n+++ b/include/libcamera/internal/v4l2_subdevice.h\n@@ -66,7 +66,7 @@ struct V4L2SubdeviceFormat {\n \tSize size;\n \tstd::optional<ColorSpace> colorSpace;\n \n-\tconst std::string toString() const;\n+\tstd::string toString() const;\n };\n \n std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f);\ndiff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\nindex ae6a76cb0..6caafc4dc 100644\n--- a/include/libcamera/internal/v4l2_videodevice.h\n+++ b/include/libcamera/internal/v4l2_videodevice.h\n@@ -178,7 +178,7 @@ public:\n \tstd::array<Plane, 3> planes;\n \tunsigned int planesCount = 0;\n \n-\tconst std::string toString() const;\n+\tstd::string toString() const;\n };\n \n std::ostream &operator<<(std::ostream &out, const V4L2DeviceFormat &f);\ndiff --git a/src/apps/cam/drm.h b/src/apps/cam/drm.h\nindex 1ba83b6eb..30a916d7e 100644\n--- a/src/apps/cam/drm.h\n+++ b/src/apps/cam/drm.h\n@@ -97,9 +97,9 @@ public:\n \n \tbool isImmutable() const { return flags_ & DRM_MODE_PROP_IMMUTABLE; }\n \n-\tconst std::vector<uint64_t> values() const { return values_; }\n+\tconst std::vector<uint64_t> &values() const { return values_; }\n \tconst std::map<uint32_t, std::string> &enums() const { return enums_; }\n-\tconst std::vector<uint32_t> blobs() const { return blobs_; }\n+\tconst std::vector<uint32_t> &blobs() const { return blobs_; }\n \n private:\n \tType type_;\ndiff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h\nindex a926002c8..8cf8bb6d1 100644\n--- a/src/ipa/libipa/histogram.h\n+++ b/src/ipa/libipa/histogram.h\n@@ -36,7 +36,7 @@ public:\n \t}\n \n \tsize_t bins() const { return cumulative_.size() - 1; }\n-\tconst Span<const uint64_t> data() const { return cumulative_; }\n+\tSpan<const uint64_t> data() const { return cumulative_; }\n \tuint64_t total() const { return cumulative_[cumulative_.size() - 1]; }\n \tuint64_t cumulativeFrequency(double bin) const;\n \tdouble quantile(double q, uint32_t first = 0, uint32_t last = UINT_MAX) const;\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex 81cc8cd53..de76d0c12 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -53,7 +53,7 @@ namespace libcamera {\n  * \\brief Assemble and return a string describing the point\n  * \\return A string describing the point\n  */\n-const std::string Point::toString() const\n+std::string Point::toString() const\n {\n \tstd::stringstream ss;\n \tss << *this;\n@@ -133,7 +133,7 @@ std::ostream &operator<<(std::ostream &out, const Point &p)\n  * \\brief Assemble and return a string describing the size\n  * \\return A string describing the size\n  */\n-const std::string Size::toString() const\n+std::string Size::toString() const\n {\n \tstd::stringstream ss;\n \tss << *this;\n@@ -676,7 +676,7 @@ std::ostream &operator<<(std::ostream &out, const SizeRange &sr)\n  * \\brief Assemble and return a string describing the rectangle\n  * \\return A string describing the Rectangle\n  */\n-const std::string Rectangle::toString() const\n+std::string Rectangle::toString() const\n {\n \tstd::stringstream ss;\n \tss << *this;\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex e31e3879d..ad20810e6 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -105,7 +105,7 @@ public:\n \tStatus validate() override;\n \n \tconst StreamConfiguration &cio2Format() const { return cio2Configuration_; }\n-\tconst ImgUDevice::PipeConfig imguConfig() const { return pipeConfig_; }\n+\tconst ImgUDevice::PipeConfig &imguConfig() const { return pipeConfig_; }\n \n \t/* Cache the combinedTransform_ that will be applied to the sensor */\n \tTransform combinedTransform_;\ndiff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\nindex 4acc091bd..28d5da3c8 100644\n--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n@@ -101,8 +101,8 @@ public:\n \tint loadIPA();\n \n \t/* Deflect these functionalities to either TPG or CameraSensor. */\n-\tconst std::vector<Size> sizes(unsigned int mbusCode) const;\n-\tconst Size resolution() const;\n+\tstd::vector<Size> sizes(unsigned int mbusCode) const;\n+\tSize resolution() const;\n \n \tint pixfmtToMbusCode(const PixelFormat &pixFmt) const;\n \tconst PixelFormat &bestRawFormat() const;\n@@ -195,7 +195,7 @@ void MaliC55CameraData::setSensorControls(const ControlList &sensorControls)\n \tdelayedCtrls_->push(sensorControls);\n }\n \n-const std::vector<Size> MaliC55CameraData::sizes(unsigned int mbusCode) const\n+std::vector<Size> MaliC55CameraData::sizes(unsigned int mbusCode) const\n {\n \tif (sensor_)\n \t\treturn sensor_->sizes(mbusCode);\n@@ -218,7 +218,7 @@ const std::vector<Size> MaliC55CameraData::sizes(unsigned int mbusCode) const\n \treturn sizes;\n }\n \n-const Size MaliC55CameraData::resolution() const\n+Size MaliC55CameraData::resolution() const\n {\n \tif (sensor_)\n \t\treturn sensor_->resolution();\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 33279654d..e9c849ac5 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -923,7 +923,7 @@ const MediaBusFormatInfo &MediaBusFormatInfo::info(uint32_t code)\n  * \\brief Assemble and return a string describing the format\n  * \\return A string describing the V4L2SubdeviceFormat\n  */\n-const std::string V4L2SubdeviceFormat::toString() const\n+std::string V4L2SubdeviceFormat::toString() const\n {\n \tstd::stringstream ss;\n \tss << *this;\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex d53aa2d3c..58a6704ef 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -429,7 +429,7 @@ bool V4L2BufferCache::Entry::operator==(const FrameBuffer &buffer) const\n  * \\brief Assemble and return a string describing the format\n  * \\return A string describing the V4L2DeviceFormat\n  */\n-const std::string V4L2DeviceFormat::toString() const\n+std::string V4L2DeviceFormat::toString() const\n {\n \tstd::stringstream ss;\n \tss << *this;\n",
    "prefixes": [
        "v1"
    ]
}