[v2,1/2] console: add console_flush_stdin()

Simon Glass sjg at chromium.org
Thu Apr 2 02:14:05 CEST 2026


On 2026-04-01T12:40:44, Gregor Herburger <gregor.herburger at linutronix.de> wrote:
> console: add console_flush_stdin()
> console: add console_flush_stdin()
>
> Add a common helper console_flush_stdin() to drain all pending
> characters from stdin. This consolidates the open-coded
> while (tstc()) getchar() pattern that appeared in multiple places
> across the tree.
>
> Signed-off-by: Gregor Herburger <gregor.herburger at linutronix.de>
> Reviewed-by: Alexander Sverdlin <alexander.sverdlin at siemens.com>
> Reviewed-by: Quentin Schulz <quentin.schulz at cherry.de>
>
> cmd/conitrace.c              |  4 ++--
>  cmd/eficonfig.c              |  6 +++---
>  cmd/eficonfig_sbkey.c        |  4 ++--
>  common/autoboot.c            | 11 +----------
>  common/console.c             | 12 ++++++++++--
>  include/console.h            |  5 +++++
>  lib/efi_loader/efi_console.c |  7 +++----
>  7 files changed, 26 insertions(+), 23 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list