get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1449477,
    "url": "http://patchwork.ozlabs.org/api/patches/1449477/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210309000247.2989531-2-danielwa@cisco.com/",
    "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": "<20210309000247.2989531-2-danielwa@cisco.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210309000247.2989531-2-danielwa@cisco.com/",
    "date": "2021-03-09T00:02:37",
    "name": "[v2,1/7] CMDLINE: add generic builtin command line",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "c0c6f4fd93f505975042f0bf9ed0ca6bae468182",
    "submitter": {
        "id": 67374,
        "url": "http://patchwork.ozlabs.org/api/people/67374/?format=api",
        "name": "Daniel Walker (danielwa)",
        "email": "danielwa@cisco.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210309000247.2989531-2-danielwa@cisco.com/mbox/",
    "series": [
        {
            "id": 232859,
            "url": "http://patchwork.ozlabs.org/api/series/232859/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=232859",
            "date": "2021-03-09T00:02:37",
            "name": "[v2,1/7] CMDLINE: add generic builtin command line",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/232859/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1449477/comments/",
    "check": "warning",
    "checks": "http://patchwork.ozlabs.org/api/patches/1449477/checks/",
    "tags": {},
    "related": [
        {
            "id": 1449472,
            "url": "http://patchwork.ozlabs.org/api/patches/1449472/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210308235319.2988609-2-danielwa@cisco.com/",
            "msgid": "<20210308235319.2988609-2-danielwa@cisco.com>",
            "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210308235319.2988609-2-danielwa@cisco.com/",
            "date": "2021-03-08T23:53:09",
            "name": "[v2,1/7] CMDLINE: add generic builtin command line",
            "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210308235319.2988609-2-danielwa@cisco.com/mbox/"
        },
        {
            "id": 1460181,
            "url": "http://patchwork.ozlabs.org/api/patches/1460181/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com/",
            "msgid": "<41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>",
            "list_archive_url": "https://lore.kernel.org/linuxppc-dev/41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com/",
            "date": "2021-03-30T17:56:56",
            "name": "[1/8] CMDLINE: add generic builtin command line",
            "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com/mbox/"
        },
        {
            "id": 1466831,
            "url": "http://patchwork.ozlabs.org/api/patches/1466831/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210416040924.2882771-2-danielwa@cisco.com/",
            "msgid": "<20210416040924.2882771-2-danielwa@cisco.com>",
            "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210416040924.2882771-2-danielwa@cisco.com/",
            "date": "2021-04-16T04:09:12",
            "name": "[1/8] CMDLINE: add generic builtin command line",
            "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210416040924.2882771-2-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>)",
            "ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=gc6BLPAj;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=gc6BLPAj;\n\tdkim-atps=neutral",
            "lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=cisco.com (client-ip=173.37.142.92;\n helo=alln-iport-5.cisco.com;\n envelope-from=danielwa@cisco.com; receiver=<UNKNOWN>)",
            "lists.ozlabs.org; dkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=gc6BLPAj; dkim-atps=neutral"
        ],
        "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 4Dvb5H1Kzyz9s1l\n\tfor <patchwork-incoming@ozlabs.org>; Tue,  9 Mar 2021 11:03:15 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4Dvb5H0GRcz3d4B\n\tfor <patchwork-incoming@ozlabs.org>; Tue,  9 Mar 2021 11:03:15 +1100 (AEDT)",
            "from alln-iport-5.cisco.com (alln-iport-5.cisco.com [173.37.142.92])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4Dvb4t0R8Gz30Ly\n for <linuxppc-dev@lists.ozlabs.org>; Tue,  9 Mar 2021 11:02:53 +1100 (AEDT)",
            "from alln-core-2.cisco.com ([173.36.13.135])\n by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 09 Mar 2021 00:02:51 +0000",
            "from zorba.cisco.com ([10.24.7.91])\n by alln-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id 12902mKb014497;\n Tue, 9 Mar 2021 00:02:49 GMT"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=7347; q=dns/txt; s=iport;\n t=1615248174; x=1616457774;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=XrNTo1a6F2LZ2llgma+xxAVT0B9gHgAbCXKn/wcLOVE=;\n b=gc6BLPAj3lL0PPprQF4p1qG7Wnbimi+B8yMHsz8eKMzJLokIGRqFxO8w\n ZuS90oclVzQmDVl83yKGaLenmfgNFpN1aDdEvg4lkIzEA9LdDmP28JSJx\n g4elBAC1O6bpNwqBNyRY0cxvNNELSfm8cPYRP1ER0UMFiNaFKV0P5MnXT s=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.81,233,1610409600\"; d=\"scan'208\";a=\"676279364\"",
        "From": "Daniel Walker <danielwa@cisco.com>",
        "To": "Will Deacon <will@kernel.org>,\n Christophe Leroy <christophe.leroy@csgroup.eu>,\n Rob Herring <robh@kernel.org>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Andrew Morton <akpm@linux-foundation.org>, x86@kernel.org,\n linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,\n xe-linux-external@cisco.com",
        "Subject": "[PATCH v2 1/7] CMDLINE: add generic builtin command line",
        "Date": "Mon,  8 Mar 2021 16:02:37 -0800",
        "Message-Id": "<20210309000247.2989531-2-danielwa@cisco.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Auto-Response-Suppress": "DR, OOF, AutoReply",
        "X-Outbound-SMTP-Client": "10.24.7.91, [10.24.7.91]",
        "X-Outbound-Node": "alln-core-2.cisco.com",
        "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": "Ruslan Bilovol <rbilovol@cisco.com>, linux-kernel@vger.kernel.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": "This code allows architectures to use a generic builtin command line.\nThe state of the builtin command line options across architecture is\ndiverse. On x86 and mips they have pretty much the same code and the\ncode prepends the builtin command line onto the boot loader provided\none. On powerpc there is only a builtin override and nothing else.\n\nThe code in this commit unifies the code into a generic\nheader file under the CONFIG_GENERIC_CMDLINE option. When this\noption is enabled the architecture can call the cmdline_add_builtin()\nto add the builtin command line.\n\nCc: xe-linux-external@cisco.com\nSigned-off-by: Ruslan Bilovol <rbilovol@cisco.com>\nSigned-off-by: Daniel Walker <danielwa@cisco.com>\n---\n include/linux/cmdline.h | 89 +++++++++++++++++++++++++++++++++++++++++\n init/Kconfig            | 68 +++++++++++++++++++++++++++++++\n 2 files changed, 157 insertions(+)\n create mode 100644 include/linux/cmdline.h",
    "diff": "diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h\nnew file mode 100644\nindex 000000000000..00929b6e49e6\n--- /dev/null\n+++ b/include/linux/cmdline.h\n@@ -0,0 +1,89 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+#ifndef _LINUX_CMDLINE_H\n+#define _LINUX_CMDLINE_H\n+\n+/*\n+ *\n+ * Copyright (C) 2006,2021. Cisco Systems, Inc.\n+ *\n+ * Generic Append/Prepend cmdline support.\n+ */\n+\n+#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_CMDLINE_BOOL)\n+\n+#ifndef CONFIG_CMDLINE_OVERRIDE\n+#define GENERIC_CMDLINE_NEED_STRLCAT\n+/*\n+ * This function will append or prepend a builtin command line to the command\n+ * line provided by the bootloader. Kconfig options can be used to alter\n+ * the behavior of this builtin command line.\n+ * @dest: The destination of the final appended/prepended string\n+ * @src: The starting string or NULL if there isn't one.\n+ * @tmp: temporary space used for prepending\n+ * @length: the maximum length of the strings above.\n+ * @cmdline_strlcpy: point to a compatible strlcpy\n+ * @cmdline_strlcat: point to a compatible strlcat\n+ */\n+static inline void\n+__cmdline_add_builtin(char *dest, const char *src, char *tmp, unsigned long length,\n+\t\tsize_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size),\n+\t\tsize_t (*cmdline_strlcat)(char *dest, const char *src, size_t count))\n+{\n+\tif (src != dest && src != NULL) {\n+\t\tcmdline_strlcpy(dest, \" \", length);\n+\t\tcmdline_strlcat(dest, src, length);\n+\t}\n+\n+\tif (sizeof(CONFIG_CMDLINE_APPEND) > 1)\n+\t\tcmdline_strlcat(dest, \" \" CONFIG_CMDLINE_APPEND, length);\n+\n+\tif (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {\n+\t\tcmdline_strlcpy(tmp, CONFIG_CMDLINE_PREPEND \" \", length);\n+\t\tcmdline_strlcat(tmp, dest, length);\n+\t\tcmdline_strlcpy(dest, tmp, length);\n+\t}\n+}\n+\n+#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)\t\t\t\\\n+{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n+\tif (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {\t\t\t\t\t\t\t\t\\\n+\t\tstatic label char cmdline_tmp_space[length];\t\t\t\t\t\t\t\\\n+\t\t__cmdline_add_builtin(dest, src, cmdline_tmp_space, length, cmdline_strlcpy, cmdline_strlcat);\t\\\n+\t} else if (sizeof(CONFIG_CMDLINE_APPEND) > 1) {\t\t\t\t\t\t\t\t\\\n+\t\t__cmdline_add_builtin(dest, src, NULL, length, cmdline_strlcpy, cmdline_strlcat);\t\t\\\n+\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n+}\n+#define cmdline_add_builtin(dest, src, length)\t\\\n+\tcmdline_add_builtin_custom(dest, src, length, __initdata, strlcpy, strlcat)\n+\n+#else /* CONFIG_CMDLINE_OVERRIDE */\n+\n+static inline void\n+__cmdline_add_builtin_custom(char *dest, const char *src, unsigned long length,\n+\t\tsize_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size))\n+{\n+\tcmdline_strlcpy(dest, CONFIG_CMDLINE_PREPEND \" \" CONFIG_CMDLINE_APPEND, length);\n+}\n+#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, cmdline_strlcpy)\n+#define cmdline_add_builtin(dest, src, length)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, strlcpy)\n+#endif /* !CONFIG_CMDLINE_OVERRIDE */\n+\n+#else /* !CONFIG_GENERIC_CMDLINE || !CONFIG_CMDLINE_BOOL */\n+\n+static inline void\n+__cmdline_add_builtin_custom(char *dest, const char *src, unsigned long length,\n+\t\tsize_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size))\n+{\n+\tif (src != NULL)\n+\t\tcmdline_strlcpy(dest, src, length);\n+}\n+#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, cmdline_strlcpy)\n+#define cmdline_add_builtin(dest, src, length)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, strlcpy)\t\\\n+\n+#endif /* CONFIG_GENERIC_CMDLINE */\n+\n+#endif /* _LINUX_CMDLINE_H */\ndiff --git a/init/Kconfig b/init/Kconfig\nindex 29ad68325028..28363ab07cd4 100644\n--- a/init/Kconfig\n+++ b/init/Kconfig\n@@ -2032,6 +2032,74 @@ config PROFILING\n config TRACEPOINTS\n \tbool\n \n+config GENERIC_CMDLINE\n+\tbool\n+\n+if GENERIC_CMDLINE\n+\n+config CMDLINE_BOOL\n+\tbool \"Built-in kernel command line\"\n+\thelp\n+\t  Allow for specifying boot arguments to the kernel at\n+\t  build time.  On some systems (e.g. embedded ones), it is\n+\t  necessary or convenient to provide some or all of the\n+\t  kernel boot arguments with the kernel itself (that is,\n+\t  to not rely on the boot loader to provide them.)\n+\n+\t  To compile command line arguments into the kernel,\n+\t  set this option to 'Y', then fill in the\n+\t  the boot arguments in CONFIG_CMDLINE.\n+\n+\t  Systems with fully functional boot loaders (i.e. non-embedded)\n+\t  should leave this option set to 'N'.\n+\n+config CMDLINE_APPEND\n+\tstring \"Built-in kernel command string append\"\n+\tdepends on CMDLINE_BOOL\n+\tdefault \"\"\n+\thelp\n+\t  Enter arguments here that should be compiled into the kernel\n+\t  image and used at boot time.  If the boot loader provides a\n+\t  command line at boot time, this string is appended to it to\n+\t  form the full kernel command line, when the system boots.\n+\n+\t  However, you can use the CONFIG_CMDLINE_OVERRIDE option to\n+\t  change this behavior.\n+\n+\t  In most cases, the command line (whether built-in or provided\n+\t  by the boot loader) should specify the device for the root\n+\t  file system.\n+\n+config CMDLINE_PREPEND\n+\tstring \"Built-in kernel command string prepend\"\n+\tdepends on CMDLINE_BOOL\n+\tdefault \"\"\n+\thelp\n+\t  Enter arguments here that should be compiled into the kernel\n+\t  image and used at boot time.  If the boot loader provides a\n+\t  command line at boot time, this string is prepended to it to\n+\t  form the full kernel command line, when the system boots.\n+\n+\t  However, you can use the CONFIG_CMDLINE_OVERRIDE option to\n+\t  change this behavior.\n+\n+\t  In most cases, the command line (whether built-in or provided\n+\t  by the boot loader) should specify the device for the root\n+\t  file system.\n+\n+config CMDLINE_OVERRIDE\n+\tbool \"Built-in command line overrides boot loader arguments\"\n+\tdepends on CMDLINE_BOOL\n+\thelp\n+\t  Set this option to 'Y' to have the kernel ignore the boot loader\n+\t  command line, and use ONLY the built-in command line. In this case\n+\t  append and prepend strings are concatenated to form the full\n+\t  command line.\n+\n+\t  This is used to work around broken boot loaders.  This should\n+\t  be set to 'N' under normal conditions.\n+endif\n+\n endmenu\t\t# General setup\n \n source \"arch/Kconfig\"\n",
    "prefixes": [
        "v2",
        "1/7"
    ]
}