get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1461762,
    "url": "http://patchwork.ozlabs.org/api/patches/1461762/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/03c0b931557967876abcebc7d0e3c6537eb6ab89.1617375802.git.christophe.leroy@csgroup.eu/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<03c0b931557967876abcebc7d0e3c6537eb6ab89.1617375802.git.christophe.leroy@csgroup.eu>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/03c0b931557967876abcebc7d0e3c6537eb6ab89.1617375802.git.christophe.leroy@csgroup.eu/",
    "date": "2021-04-02T15:18:07",
    "name": "[v4,06/20] powerpc: convert strcpy to strlcpy in prom_init",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "080ba59b05063ce3ee7e20b048c489d09b31ff4e",
    "submitter": {
        "id": 79086,
        "url": "http://patchwork.ozlabs.org/api/people/79086/?format=api",
        "name": "Christophe Leroy",
        "email": "christophe.leroy@csgroup.eu"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/03c0b931557967876abcebc7d0e3c6537eb6ab89.1617375802.git.christophe.leroy@csgroup.eu/mbox/",
    "series": [
        {
            "id": 237158,
            "url": "http://patchwork.ozlabs.org/api/series/237158/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=237158",
            "date": "2021-04-02T15:18:03",
            "name": "Implement GENERIC_CMDLINE",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/237158/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1461762/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1461762/checks/",
    "tags": {},
    "related": [
        {
            "id": 1460184,
            "url": "http://patchwork.ozlabs.org/api/patches/1460184/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/0c80a08ad4cf788c75043c1615c05bad893f4fde.1617126961.git.danielwa@cisco.com/",
            "msgid": "<0c80a08ad4cf788c75043c1615c05bad893f4fde.1617126961.git.danielwa@cisco.com>",
            "list_archive_url": "https://lore.kernel.org/linuxppc-dev/0c80a08ad4cf788c75043c1615c05bad893f4fde.1617126961.git.danielwa@cisco.com/",
            "date": "2021-03-30T17:56:58",
            "name": "[3/8] powerpc: convert strcpy to strlcpy in prom_init",
            "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/0c80a08ad4cf788c75043c1615c05bad893f4fde.1617126961.git.danielwa@cisco.com/mbox/"
        }
    ],
    "headers": {
        "Return-Path": "\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)",
            "lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr;\n envelope-from=christophe.leroy@csgroup.eu; receiver=<UNKNOWN>)"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4FBkKQ5xKZz9sRf\n\tfor <patchwork-incoming@ozlabs.org>; Sat,  3 Apr 2021 02:21:14 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FBkKQ427Dz3dkW\n\tfor <patchwork-incoming@ozlabs.org>; Sat,  3 Apr 2021 02:21:14 +1100 (AEDT)",
            "from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4FBkFx5V9rz3btY\n for <linuxppc-dev@lists.ozlabs.org>; Sat,  3 Apr 2021 02:18:13 +1100 (AEDT)",
            "from localhost (mailhub1-int [192.168.12.234])\n by localhost (Postfix) with ESMTP id 4FBkFp6jM7z9v2m7;\n Fri,  2 Apr 2021 17:18:06 +0200 (CEST)",
            "from pegase1.c-s.fr ([192.168.12.234])\n by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024)\n with ESMTP id Rp6dCVo7JWFW; Fri,  2 Apr 2021 17:18:06 +0200 (CEST)",
            "from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192])\n by pegase1.c-s.fr (Postfix) with ESMTP id 4FBkFp5qTGz9v2ls;\n Fri,  2 Apr 2021 17:18:06 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id 8E5668BB7D;\n Fri,  2 Apr 2021 17:18:08 +0200 (CEST)",
            "from messagerie.si.c-s.fr ([127.0.0.1])\n by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023)\n with ESMTP id gXDC2XbWW9k9; Fri,  2 Apr 2021 17:18:08 +0200 (CEST)",
            "from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id C3C0D8BB7C;\n Fri,  2 Apr 2021 17:18:07 +0200 (CEST)",
            "by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0)\n id 960AD67989; Fri,  2 Apr 2021 15:18:07 +0000 (UTC)"
        ],
        "X-Virus-Scanned": [
            "Debian amavisd-new at c-s.fr",
            "amavisd-new at c-s.fr"
        ],
        "Message-Id": "\n <03c0b931557967876abcebc7d0e3c6537eb6ab89.1617375802.git.christophe.leroy@csgroup.eu>",
        "In-Reply-To": "<cover.1617375802.git.christophe.leroy@csgroup.eu>",
        "References": "<cover.1617375802.git.christophe.leroy@csgroup.eu>",
        "From": "Christophe Leroy <christophe.leroy@csgroup.eu>",
        "Subject": "[PATCH v4 06/20] powerpc: convert strcpy to strlcpy in prom_init",
        "To": "will@kernel.org, danielwa@cisco.com, robh@kernel.org,\n daniel@gimpelevich.san-francisco.ca.us, arnd@kernel.org,\n akpm@linux-foundation.org",
        "Date": "Fri,  2 Apr 2021 15:18:07 +0000 (UTC)",
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "linux-arch@vger.kernel.org, devicetree@vger.kernel.org,\n microblaze <monstr@monstr.eu>, linux-xtensa@linux-xtensa.org,\n linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, x86@kernel.org,\n linux-kernel@vger.kernel.org, nios2 <ley.foon.tan@intel.com>,\n linux-mips@vger.kernel.org, linux-mm@kvack.org,\n openrisc@lists.librecores.org,\n sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org,\n linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "From: Daniel Walker <danielwa@cisco.com>\n\nThere's only two users of strcpy and one is the command\nline handling. The generic command line handling uses strlcpy\nand it makes sense to convert this one other user to strlcpy to\nkeep prom_init size consistent.\n\nCc: xe-linux-external@cisco.com\nSigned-off-by: Daniel Walker <danielwa@cisco.com>\nSigned-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>\n---\n arch/powerpc/kernel/prom_init.c | 25 +++++++++++++++----------\n 1 file changed, 15 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c\nindex 41ed7e33d897..33316ee55265 100644\n--- a/arch/powerpc/kernel/prom_init.c\n+++ b/arch/powerpc/kernel/prom_init.c\n@@ -242,15 +242,6 @@ static int __init prom_strcmp(const char *cs, const char *ct)\n \treturn 0;\n }\n \n-static char __init *prom_strcpy(char *dest, const char *src)\n-{\n-\tchar *tmp = dest;\n-\n-\twhile ((*dest++ = *src++) != '\\0')\n-\t\t/* nothing */;\n-\treturn tmp;\n-}\n-\n static int __init prom_strncmp(const char *cs, const char *ct, size_t count)\n {\n \tunsigned char c1, c2;\n@@ -276,6 +267,20 @@ static size_t __init prom_strlen(const char *s)\n \treturn sc - s;\n }\n \n+static size_t __init prom_strlcpy(char *dest, const char *src, size_t size)\n+{\n+\tsize_t ret = prom_strlen(src);\n+\n+\tif (size) {\n+\t\tsize_t len = (ret >= size) ? size - 1 : ret;\n+\n+\t\tmemcpy(dest, src, len);\n+\t\tdest[len] = '\\0';\n+\t}\n+\treturn ret;\n+}\n+\n+\n static int __init prom_memcmp(const void *cs, const void *ct, size_t count)\n {\n \tconst unsigned char *su1, *su2;\n@@ -2702,7 +2707,7 @@ static void __init flatten_device_tree(void)\n \n \t/* Add \"phandle\" in there, we'll need it */\n \tnamep = make_room(&mem_start, &mem_end, 16, 1);\n-\tprom_strcpy(namep, \"phandle\");\n+\tprom_strlcpy(namep, \"phandle\", 8);\n \tmem_start = (unsigned long)namep + prom_strlen(namep) + 1;\n \n \t/* Build string array */\n",
    "prefixes": [
        "v4",
        "06/20"
    ]
}