get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218559,
    "url": "http://patchwork.ozlabs.org/api/patches/2218559/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260401124128.178799-2-gregor.herburger@linutronix.de/",
    "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": "<20260401124128.178799-2-gregor.herburger@linutronix.de>",
    "list_archive_url": null,
    "date": "2026-04-01T12:40:44",
    "name": "[v2,1/2] console: add console_flush_stdin()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0e3c765c0e3a39f3ec2c45641affe445f2b66d8f",
    "submitter": {
        "id": 93018,
        "url": "http://patchwork.ozlabs.org/api/people/93018/?format=api",
        "name": "Gregor Herburger",
        "email": "gregor.herburger@linutronix.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260401124128.178799-2-gregor.herburger@linutronix.de/mbox/",
    "series": [
        {
            "id": 498331,
            "url": "http://patchwork.ozlabs.org/api/series/498331/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498331",
            "date": "2026-04-01T12:40:44",
            "name": "[v2,1/2] console: add console_flush_stdin()",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498331/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218559/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218559/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 secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256\n header.s=2020 header.b=fCSLdYhP;\n\tdkim=pass header.d=linutronix.de header.i=@linutronix.de\n header.a=ed25519-sha256 header.s=2020e header.b=dIj3FTjP;\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=linutronix.de",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=linutronix.de header.i=@linutronix.de header.b=\"fCSLdYhP\";\n\tdkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de\n header.b=\"dIj3FTjP\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linutronix.de",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=gregor.herburger@linutronix.de"
        ],
        "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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fm4kq6tBWz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 23:57:07 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 07B8E84101;\n\tWed,  1 Apr 2026 14:56:21 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id B2F4883F5B; Wed,  1 Apr 2026 14:42:27 +0200 (CEST)",
            "from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 20E7283CE3\n for <u-boot@lists.denx.de>; Wed,  1 Apr 2026 14:42:25 +0200 (CEST)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2",
        "From": "Gregor Herburger <gregor.herburger@linutronix.de>",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;\n s=2020; t=1775047344;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=SEv/bT844UAZ9PNQZJ6/YMZKcrMDuqLppaal6aglFJE=;\n b=fCSLdYhPd/52eUU0KtSRQvoAjpva8S9q46I1ZiW/wTiul+gBIkD0Hg5NuaTR9vB9BuzBI5\n x0/7SFyJLKh63InyJ3RPxT3nBGl6CxRvdL1JpOSEH52zanX4n5JCCqwev4kUXGy4YG5kUl\n Pu1ek87U8werUE5S7NiV/RstByh/aNH7/aPFgIvOS33Fagqed23eZz64RCh6t+gKamxjuK\n oOd5IFRrsXSMbNMk3ape0+Xxs2z1+JBIBMi4eWBMsUWsKKfmFrhn1unJh2pye89eayhLKx\n YgLn6WCWNYsrXeekI1rHXCY7H7rS55JtX6J9LFqmhn10hT2gLQmXATDlKtorWQ==",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;\n s=2020e; t=1775047344;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=SEv/bT844UAZ9PNQZJ6/YMZKcrMDuqLppaal6aglFJE=;\n b=dIj3FTjPJF/0H0/tiKK5uT+juFZSQGz71ryRvH2ETRaJyW9RLziez1C6cArO4tlxl2RgCE\n yxr7bBpgqz/9xKDw=="
        ],
        "To": "u-boot@lists.denx.de,\n\tQuentin Schulz <quentin.schulz@cherry.de>",
        "Cc": "Gregor Herburger <gregor.herburger@linutronix.de>,\n Alexander Sverdlin <alexander.sverdlin@siemens.com>,\n Andre Przywara <andre.przywara@arm.com>,\n Casey Connolly <casey.connolly@linaro.org>,\n David Zang <davidzangcs@gmail.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Sam Protsenko <semen.protsenko@linaro.org>, Simon Glass <sjg@chromium.org>,\n Sughosh Ganu <sughosh.ganu@arm.com>, Tom Rini <trini@konsulko.com>",
        "Subject": "[PATCH v2 1/2] console: add console_flush_stdin()",
        "Date": "Wed,  1 Apr 2026 14:40:44 +0200",
        "Message-ID": "<20260401124128.178799-2-gregor.herburger@linutronix.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Wed, 01 Apr 2026 14:56:19 +0200",
        "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": "Add a common helper console_flush_stdin() to drain all pending\ncharacters from stdin. This consolidates the open-coded\nwhile (tstc()) getchar() pattern that appeared in multiple places\nacross the tree.\n\nSigned-off-by: Gregor Herburger <gregor.herburger@linutronix.de>\n---\n\n(no changes since v1)\n\n cmd/conitrace.c              |  4 ++--\n cmd/eficonfig.c              |  6 +++---\n cmd/eficonfig_sbkey.c        |  4 ++--\n common/autoboot.c            | 11 +----------\n common/console.c             | 12 ++++++++++--\n include/console.h            |  5 +++++\n lib/efi_loader/efi_console.c |  7 +++----\n 7 files changed, 26 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/cmd/conitrace.c b/cmd/conitrace.c\nindex 6cc113328eb..aef094e03df 100644\n--- a/cmd/conitrace.c\n+++ b/cmd/conitrace.c\n@@ -6,6 +6,7 @@\n  * Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de>\n  */\n #include <command.h>\n+#include <console.h>\n #include <linux/delay.h>\n \n static int do_conitrace(struct cmd_tbl *cmdtp, int flag, int argc,\n@@ -17,8 +18,7 @@ static int do_conitrace(struct cmd_tbl *cmdtp, int flag, int argc,\n \tprintf(\"To terminate type 'x'\\n\");\n \n \t/* Empty input buffer */\n-\twhile (tstc())\n-\t\tgetchar();\n+\tconsole_flush_stdin();\n \n \tfor (;;) {\n \t\tint c = getchar();\ndiff --git a/cmd/eficonfig.c b/cmd/eficonfig.c\nindex d8d946c87ac..60c39bc3a99 100644\n--- a/cmd/eficonfig.c\n+++ b/cmd/eficonfig.c\n@@ -6,8 +6,9 @@\n  */\n \n #include <ansi.h>\n-#include <cli.h>\n #include <charset.h>\n+#include <cli.h>\n+#include <console.h>\n #include <efi_device_path.h>\n #include <efi_loader.h>\n #include <efi_load_initrd.h>\n@@ -167,8 +168,7 @@ static void eficonfig_menu_adjust(struct efimenu *efi_menu, bool add)\n void eficonfig_print_msg(char *msg)\n {\n \t/* Flush input */\n-\twhile (tstc())\n-\t\tgetchar();\n+\tconsole_flush_stdin();\n \n \tprintf(ANSI_CURSOR_HIDE\n \t       ANSI_CLEAR_CONSOLE\ndiff --git a/cmd/eficonfig_sbkey.c b/cmd/eficonfig_sbkey.c\nindex b3325a540f9..a6c5416d3a5 100644\n--- a/cmd/eficonfig_sbkey.c\n+++ b/cmd/eficonfig_sbkey.c\n@@ -7,6 +7,7 @@\n \n #include <ansi.h>\n #include <charset.h>\n+#include <console.h>\n #include <hexdump.h>\n #include <log.h>\n #include <malloc.h>\n@@ -288,8 +289,7 @@ static efi_status_t eficonfig_process_show_siglist(void *data)\n \t\t}\n \t}\n \n-\twhile (tstc())\n-\t\tgetchar();\n+\tconsole_flush_stdin();\n \n \tprintf(\"\\n\\n  Press any key to continue\");\n \tgetchar();\ndiff --git a/common/autoboot.c b/common/autoboot.c\nindex 1783ef92c94..4b80ddb5b28 100644\n--- a/common/autoboot.c\n+++ b/common/autoboot.c\n@@ -315,15 +315,6 @@ static int passwd_abort_key(uint64_t etime)\n \treturn abort;\n }\n \n-/**\n- * flush_stdin() - drops all pending characters from stdin\n- */\n-static void flush_stdin(void)\n-{\n-\twhile (tstc())\n-\t\t(void)getchar();\n-}\n-\n /**\n  * fallback_to_sha256() - check whether we should fall back to sha256\n  *                        password checking\n@@ -354,7 +345,7 @@ static int abortboot_key_sequence(int bootdelay)\n \tuint64_t etime = endtick(bootdelay);\n \n \tif (IS_ENABLED(CONFIG_AUTOBOOT_FLUSH_STDIN))\n-\t\tflush_stdin();\n+\t\tconsole_flush_stdin();\n #  ifdef CONFIG_AUTOBOOT_PROMPT\n \t/*\n \t * CONFIG_AUTOBOOT_PROMPT includes the %d for all boards.\ndiff --git a/common/console.c b/common/console.c\nindex 48586fd2166..90b437fd1fc 100644\n--- a/common/console.c\n+++ b/common/console.c\n@@ -643,6 +643,15 @@ int tstc(void)\n \treturn serial_tstc();\n }\n \n+/**\n+ * console_flush_stdin() - drops all pending characters from stdin\n+ */\n+void console_flush_stdin(void)\n+{\n+\twhile (tstc())\n+\t\t(void)getchar();\n+}\n+\n #define PRE_CONSOLE_FLUSHPOINT1_SERIAL\t\t\t0\n #define PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL\t1\n \n@@ -914,8 +923,7 @@ int confirm_yesno(void)\n \tchar str_input[5];\n \n \t/* Flush input */\n-\twhile (tstc())\n-\t\tgetchar();\n+\tconsole_flush_stdin();\n \ti = 0;\n \twhile (i < sizeof(str_input)) {\n \t\tstr_input[i] = getchar();\ndiff --git a/include/console.h b/include/console.h\nindex 8d0d7bb8a4c..01a04f28f31 100644\n--- a/include/console.h\n+++ b/include/console.h\n@@ -202,6 +202,11 @@ int console_clear(void);\n  */\n int console_remove_by_name(const char *name);\n \n+/**\n+ * console_flush_stdin() - drops all pending characters from stdin\n+ */\n+void console_flush_stdin(void);\n+\n /*\n  * CONSOLE multiplexing.\n  */\ndiff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c\nindex 068d1a0a7b7..f83415f2ed3 100644\n--- a/lib/efi_loader/efi_console.c\n+++ b/lib/efi_loader/efi_console.c\n@@ -9,6 +9,7 @@\n \n #include <ansi.h>\n #include <charset.h>\n+#include <console.h>\n #include <efi_device_path.h>\n #include <malloc.h>\n #include <time.h>\n@@ -299,8 +300,7 @@ static int query_console_serial(int *rows, int *cols)\n \tint n[2];\n \n \t/* Empty input buffer */\n-\twhile (tstc())\n-\t\tgetchar();\n+\tconsole_flush_stdin();\n \n \t/*\n \t * Not all terminals understand CSI [18t for querying the console size.\n@@ -957,8 +957,7 @@ static void efi_cin_check(void)\n  */\n static void efi_cin_empty_buffer(void)\n {\n-\twhile (tstc())\n-\t\tgetchar();\n+\tconsole_flush_stdin();\n \tkey_available = false;\n }\n \n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}