get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218594,
    "url": "http://patchwork.ozlabs.org/api/patches/2218594/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260401-casey-ccf-compat-v2-3-414d5b7f040b@linaro.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260401-casey-ccf-compat-v2-3-414d5b7f040b@linaro.org>",
    "list_archive_url": null,
    "date": "2026-04-01T14:15:19",
    "name": "[v2,03/11] string: add strdup_const and kstrdup_const",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4563d9259ba42e44be8b3ba132b951b55aa7c919",
    "submitter": {
        "id": 90679,
        "url": "http://patchwork.ozlabs.org/api/people/90679/?format=api",
        "name": "Casey Connolly",
        "email": "casey.connolly@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260401-casey-ccf-compat-v2-3-414d5b7f040b@linaro.org/mbox/",
    "series": [
        {
            "id": 498341,
            "url": "http://patchwork.ozlabs.org/api/series/498341/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498341",
            "date": "2026-04-01T14:15:17",
            "name": "Linux compat improvements and CCF prep",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498341/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218594/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218594/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=YFmalPzq;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"YFmalPzq\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=casey.connolly@linaro.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fm6Tr466Rz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 01:16:00 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 062D0840CC;\n\tWed,  1 Apr 2026 16:15:32 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 9B910840AA; Wed,  1 Apr 2026 16:15:30 +0200 (CEST)",
            "from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n [IPv6:2a00:1450:4864:20::333])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 8DC5183CF5\n for <u-boot@lists.denx.de>; Wed,  1 Apr 2026 16:15:28 +0200 (CEST)",
            "by mail-wm1-x333.google.com with SMTP id\n 5b1f17b1804b1-486fc4725f0so13019765e9.1\n for <u-boot@lists.denx.de>; Wed, 01 Apr 2026 07:15:28 -0700 (PDT)",
            "from lion.localdomain (p4fc3dd86.dip0.t-ipconnect.de.\n [79.195.221.134]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4887c8bcaf8sm43224135e9.27.2026.04.01.07.15.26\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 Apr 2026 07:15:26 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775052928; x=1775657728; darn=lists.denx.de;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=OJvm8hJq5dvTL5t+nuiKKxZ20+5uLhO/dmppj5+JcmU=;\n b=YFmalPzqPa5zddTkWcgjORxrdVIf0GLEatKRRuCldOdL+kunurwM+JBU53T0+LDssL\n WPJjq1MzcOJIBA3Rcc6h+hGq3WeqXN6xBUavMyFrl7OFFt2cMbas/qCFRgimmcT3AJGh\n ngqv6fVqGkz62K5l95Qk3C1QvnLifAIXSLSC8zyEtIxOevLhe3b/1myVe9ObdoIc2AZ7\n 1aUpW0+1ShMVUa/kaFe6OUN6Yy/mTJrVdbSHsMph63nW/OliniD2vTegeRV26VsQmeCW\n 5VNNCpT8q6uO+rluiX9VF5mww9s6oDQNBTN5L94ffW5syboRxBpfIro93nBPURQheo48\n TxNw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775052928; x=1775657728;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=OJvm8hJq5dvTL5t+nuiKKxZ20+5uLhO/dmppj5+JcmU=;\n b=J7/zkP6Dr3bYr0+YX1mdjuqHS6pjOABlMJkD3B6+a0+evXqGyJwNAPanpWEA9sQXXk\n Ja51kQxnLiFsR3VMUhyRjZf5CMb6vbLivwsE9SezC9GKVkHZ+ydohBmCd8/4rbap/roV\n U2k/QonFV7ty+GeBLCagbUZoItsrQCQg55KrtsCemobnqDzRB4gi/XWwG5+jhW3NFk9V\n hLZnG+8VS1z1U2UwAAfc9t+bnwmmpemGeughIOM4N4Qa7WYm+UpYaUtH6PWv61+rq0+A\n 9WTt8lAl2Uoqbl0s33XDGnmb8mkAxtrUL7jgjf4OZ/of3skLjBdsRrhjYDE13P3Afrmw\n 4UuA==",
        "X-Gm-Message-State": "AOJu0YzFSo8BEpwHYDFouOFVVKzwMCaG83KFj4peJ832K8fLP6UI3m4d\n BqTgu6+MRdsxuMNPHk6azkeY8799iO+R+ypiN82uFt4r8Vt6kyIlpqMh0+ELjOemvFw=",
        "X-Gm-Gg": "ATEYQzxZ2pEr+Df68SFJ8vWWB4hyTKk8prkAmZPXADYIUbOqYlg+bZeStPE1yoIAKU8\n zECvc75rznFooB7/v+WgGDXpQJ7lvCSithMeiDRe0XMm0NsiVd2hIW06i08Rpjdr8EBTedZLgy4\n DObknMFsnOtkmZBtzvTrdJpS3HgaC+VTn+Ht9rcb6e4o7nU7fG22yt4njmkJxAtsHJSazGYMASj\n rtnquk24jL7n+beUkmJHu3EeELvnzP4JnyjUdym1+GLF+RmJvP+j1W0Lqz0uEnpqrbDE7tvWihS\n +sUFirkrO0XmgWBNygFMw4uUV2UW6vRep4zWR3xi53dC64QN3HI03lJjIca2ZT9S9xU1bvVWDhj\n J0hTGHqvwxx0nMWESrvXjI9tEa9sKr9F5w8CGgjEWxJIUATsgrak+8FhbSTjOO6uWN8wmKMfukF\n dZkJ9TieZ3B1dkXd7430a/mr77uMv7aqIzwufoeSm7we4FSQlFL8Hg53g7bWsIZEnSII+4",
        "X-Received": "by 2002:a05:600c:8184:b0:485:3428:774c with SMTP id\n 5b1f17b1804b1-48883575bfbmr59613225e9.4.1775052927751;\n Wed, 01 Apr 2026 07:15:27 -0700 (PDT)",
        "From": "Casey Connolly <casey.connolly@linaro.org>",
        "Date": "Wed, 01 Apr 2026 16:15:19 +0200",
        "Subject": "[PATCH v2 03/11] string: add strdup_const and kstrdup_const",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260401-casey-ccf-compat-v2-3-414d5b7f040b@linaro.org>",
        "References": "<20260401-casey-ccf-compat-v2-0-414d5b7f040b@linaro.org>",
        "In-Reply-To": "<20260401-casey-ccf-compat-v2-0-414d5b7f040b@linaro.org>",
        "To": "u-boot@lists.denx.de",
        "Cc": "Tom Rini <trini@konsulko.com>,\n Casey Connolly <casey.connolly@linaro.org>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Simon Glass <sjg@chromium.org>,\n Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,\n Romain Gantois <romain.gantois@bootlin.com>,\n Andrew Goodbody <andrew.goodbody@linaro.org>,\n Patrice Chotard <patrice.chotard@foss.st.com>,\n Raymond Mao <raymondmaoca@gmail.com>, Peng Fan <peng.fan@nxp.com>",
        "X-Mailer": "b4 0.15-dev-47773",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=4099;\n i=casey.connolly@linaro.org; h=from:subject:message-id;\n bh=5jwUMh0k+N1QnC8WW0D/qoE/XYGivWXyZ6pP2y+2UGs=;\n b=kA0DAAgReTBFn7kwMhcByyZiAGnNKHmggsWcTW3ArsECDhmbGF/UuHuzITyy/JVb9Aod6QUpv\n Yh1BAARCAAdFiEEF8imOYKt0z8ot6DQeTBFn7kwMhcFAmnNKHkACgkQeTBFn7kwMhc8AQEAk0fs\n J46w655p1IEnAosIiwCJQK3lw+VqGvyiXlHoqKoA/0J9VyFTEPZ0otojW1Ca/X7mexmtUkb6SrR\n aEEnFiiDO",
        "X-Developer-Key": "i=casey.connolly@linaro.org; a=openpgp;\n fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "Extend Linux compat by adding kstrdup_const(), backed by lib/string.c.\nThis leverages U-Boots .rodata section on ARM64 to avoid pointlessly\nduplicating const strings.\n\nThis is used by the Linux CCF_FULL port and may be useful elsewhere\nin U-Boot.\n\nSigned-off-by: Casey Connolly <casey.connolly@linaro.org>\n---\n include/asm-generic/sections.h | 19 +++++++++++++++++++\n include/linux/compat.h         | 13 +++++++++++++\n include/linux/string.h         |  2 ++\n lib/string.c                   | 31 +++++++++++++++++++++++++++++++\n 4 files changed, 65 insertions(+)",
    "diff": "diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h\nindex d59787948fd1..48bd4fa86043 100644\n--- a/include/asm-generic/sections.h\n+++ b/include/asm-generic/sections.h\n@@ -8,8 +8,9 @@\n #ifndef _ASM_GENERIC_SECTIONS_H_\n #define _ASM_GENERIC_SECTIONS_H_\n \n #include <linux/types.h>\n+#include <stdbool.h>\n \n /* References to section boundaries */\n \n extern char _text[], _stext[], _etext[];\n@@ -61,8 +62,26 @@ static inline int arch_is_kernel_data(unsigned long addr)\n \treturn 0;\n }\n #endif\n \n+/**\n+ * is_kernel_rodata - checks if the pointer address is located in the\n+ *                    .rodata section\n+ *\n+ * @addr: address to check\n+ *\n+ * Returns: true if the address is located in .rodata, false otherwise.\n+ */\n+static inline bool is_kernel_rodata(unsigned long addr)\n+{\n+#ifdef CONFIG_ARM64\n+\treturn addr >= (unsigned long)__start_rodata &&\n+\t       addr < (unsigned long)__end_rodata;\n+#else\n+\treturn false;\n+#endif\n+}\n+\n /* U-Boot-specific things begin here */\n \n /* Start of U-Boot text region */\n extern char __text_start[];\ndiff --git a/include/linux/compat.h b/include/linux/compat.h\nindex 623814516175..d4ba4d0088a0 100644\n--- a/include/linux/compat.h\n+++ b/include/linux/compat.h\n@@ -66,8 +66,21 @@ static inline void vfree(const void *addr)\n {\n \tfree((void *)addr);\n }\n \n+/**\n+ * kstrdup_const - conditionally duplicate an existing const string\n+ * @s: the string to duplicate\n+ * @gfp: the GFP mask used in the kmalloc() call when allocating memory\n+ *\n+ * Note: Strings allocated by kstrdup_const should be freed by kfree_const and\n+ * must not be passed to krealloc().\n+ *\n+ * Return: source string if it is in .rodata section otherwise\n+ * fallback to kstrdup.\n+ */\n+#define kstrdup_const(s, gfp) strdup_const(s)\n+\n struct kmem_cache { int sz; };\n \n struct kmem_cache *get_mem(int element_sz);\n #define kmem_cache_create(a, sz, c, d, e)\tget_mem(sz)\ndiff --git a/include/linux/string.h b/include/linux/string.h\nindex d943fcce690c..a8a6cf4af505 100644\n--- a/include/linux/string.h\n+++ b/include/linux/string.h\n@@ -103,8 +103,10 @@ size_t strcspn(const char *s, const char *reject);\n \n #ifndef __HAVE_ARCH_STRDUP\n extern char * strdup(const char *);\n extern char * strndup(const char *, size_t);\n+extern const char *strdup_const(const char *s);\n+extern void kfree_const(const void *x);\n #endif\n #ifndef __HAVE_ARCH_STRSWAB\n extern char * strswab(const char *);\n #endif\ndiff --git a/lib/string.c b/lib/string.c\nindex d56f88d4a847..302efe048b07 100644\n--- a/lib/string.c\n+++ b/lib/string.c\n@@ -378,8 +378,39 @@ char * strndup(const char *s, size_t n)\n \tnew[len] = '\\0';\n \n \treturn new;\n }\n+\n+/**\n+ * strdup_const - conditionally duplicate an existing const string\n+ * @s: the string to duplicate\n+ *\n+ * Note: Strings allocated by kstrdup_const should be freed by kfree_const and\n+ * must not be passed to krealloc().\n+ *\n+ * Return: source string if it is in .rodata section otherwise\n+ * fallback to kstrdup.\n+ */\n+const char *strdup_const(const char *s)\n+{\n+\tif (is_kernel_rodata((unsigned long)s))\n+\t\treturn s;\n+\n+\treturn strdup(s);\n+}\n+\n+/**\n+ * kfree_const - conditionally free memory\n+ * @x: pointer to the memory\n+ *\n+ * Function calls kfree only if @x is not in .rodata section.\n+ */\n+void kfree_const(const void *x)\n+{\n+\tif (!is_kernel_rodata((unsigned long)x))\n+\t\tfree((void *)x);\n+}\n+\n #endif\n \n #ifndef __HAVE_ARCH_STRSPN\n /**\n",
    "prefixes": [
        "v2",
        "03/11"
    ]
}