Show a patch.

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

{
    "id": 20561,
    "url": "https://patchwork.libcamera.org/api/patches/20561/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20561/",
    "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": "<20240703192924.10643-1-laurent.pinchart@ideasonboard.com>",
    "date": "2024-07-03T19:29:24",
    "name": "libcamera: base: utils: Implement hex() for 8-bit and 16-bit values",
    "commit_ref": "45bd1f20f6a9c9b97972944358c75beb9dfafb9c",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "03ccc2a141ebbeb38506fbbec576c43f3b97adb2",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20561/mbox/",
    "series": [
        {
            "id": 4441,
            "url": "https://patchwork.libcamera.org/api/series/4441/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4441",
            "date": "2024-07-03T19:29:24",
            "name": "libcamera: base: utils: Implement hex() for 8-bit and 16-bit values",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4441/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20561/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20561/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 9B64DBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Jul 2024 19:29:48 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA30962C96;\n\tWed,  3 Jul 2024 21:29:47 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4BA0962C95\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Jul 2024 21:29:46 +0200 (CEST)",
            "from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DBC723E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Jul 2024 21:29:17 +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=\"u942kQrh\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720034957;\n\tbh=40gXhFRiu8FxUwdSxfFO1V7ZZlqZk+Qky4RF9Jjw3wY=;\n\th=From:To:Subject:Date:From;\n\tb=u942kQrh+mYjKydexWdk9UIx3x50LEIdYuu0H19uZttJVRMD7/Uq9CS6+BO+sx08h\n\tvt8fpgaXzHxRM7MsF4mX3eMZ2tO1UtpgmA2/C//sf9kAG/QhW+enuhJGKKYoqlGRoG\n\tv+njwZwJkDi2v9pwX7Gb7fYzeP3xojqUZQYl+81g=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH] libcamera: base: utils: Implement hex() for 8-bit and 16-bit\n\tvalues",
        "Date": "Wed,  3 Jul 2024 22:29:24 +0300",
        "Message-ID": "<20240703192924.10643-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.2",
        "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": "The utils::hex() function is implemented for 32-bit and 64-bit integers,\nbut not for 8-bit and 16-bit. This causes a link error (possibly at\nruntime for IPA modules due to lazy linking) when trying to print 8-bit\nor 16-bit integers. Implement additional specializations to fix it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/utils.h | 24 ++++++++++++++++++++++++\n 1 file changed, 24 insertions(+)\n\n\nbase-commit: 196abb8d1d6e0fe9d190315e72a85eb12d16a554",
    "diff": "diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\nindex 4ae02dc97478..734ff81e2860 100644\n--- a/include/libcamera/base/utils.h\n+++ b/include/libcamera/base/utils.h\n@@ -90,6 +90,30 @@ template<typename T,\n _hex hex(T value, unsigned int width = 0);\n \n #ifndef __DOXYGEN__\n+template<>\n+inline _hex hex<int8_t>(int8_t value, unsigned int width)\n+{\n+\treturn { static_cast<uint64_t>(value), width ? width : 2 };\n+}\n+\n+template<>\n+inline _hex hex<uint8_t>(uint8_t value, unsigned int width)\n+{\n+\treturn { static_cast<uint64_t>(value), width ? width : 2 };\n+}\n+\n+template<>\n+inline _hex hex<int16_t>(int16_t value, unsigned int width)\n+{\n+\treturn { static_cast<uint64_t>(value), width ? width : 4 };\n+}\n+\n+template<>\n+inline _hex hex<uint16_t>(uint16_t value, unsigned int width)\n+{\n+\treturn { static_cast<uint64_t>(value), width ? width : 4 };\n+}\n+\n template<>\n inline _hex hex<int32_t>(int32_t value, unsigned int width)\n {\n",
    "prefixes": []
}