Hi Sam,

Thank you for the patch.

On Tue, Jun 02, 2026 at 18:45, Sam Day via B4 Relay 
<[email protected]> wrote:

> From: Sam Day <[email protected]>
>
> Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
> abort fastboot mode (rather than only ctrl-c).
>
> Signed-off-by: Sam Day <[email protected]>
> ---
>  cmd/Kconfig    | 6 ++++++
>  cmd/fastboot.c | 9 ++++++++-
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index c71c6824a19..439409d6f2c 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -1208,6 +1208,12 @@ config CMD_FASTBOOT
>  
>         See doc/android/fastboot.rst for more information.
>  
> +config CMD_FASTBOOT_ABORT_KEYED
> +     bool "fastboot abort with any key"
> +     depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
> +     help
> +       Allow interruption of USB fastboot mode with any key pressed.
> +

It seems that checkpatch is unhappy about this:

$ ./scripts/checkpatch.pl --git master..
-------------------------------------------------------------
Commit 9b68236a90bc ("cmd: fastboot: Add keyed abort option")
-------------------------------------------------------------
WARNING: please write a help paragraph that fully describes the config symbol 
with at least 2 lines
#26: FILE: cmd/Kconfig:1211:
+config CMD_FASTBOOT_ABORT_KEYED
+       bool "fastboot abort with any key"
+       depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
+       help
+         Allow interruption of USB fastboot mode with any key pressed.
+

total: 0 errors, 1 warnings, 0 checks, 28 lines checked

I'd suggest the following edit:

+         Allow interruption of USB fastboot mode with any key pressed
+         instead of just Ctrl-c.

If you wish, I can do this edit while applying.

With the above change included:

Reviewed-by: Mattijs Korpershoek <[email protected]>

>  config CMD_FLASH
>       bool "flinfo, erase, protect"
>       default y
> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
> index e71f873527b..f3929f88dfa 100644
> --- a/cmd/fastboot.c
> +++ b/cmd/fastboot.c
> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
>       while (1) {
>               if (g_dnl_detach())
>                       break;
> -             if (ctrlc())
> +             if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
> +                     if (tstc()) {
> +                             getchar();
> +                             puts("\rOperation aborted.\n");
> +                             break;
> +                     }
> +             } else if (ctrlc()) {
>                       break;
> +             }
>               schedule();
>               dm_usb_gadget_handle_interrupts(udc);
>       }
>
> -- 
> 2.54.0

Reply via email to