diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/autoboot.c | 11 | ||||
| -rw-r--r-- | common/console.c | 12 |
2 files changed, 11 insertions, 12 deletions
diff --git a/common/autoboot.c b/common/autoboot.c index 1783ef92c94..4b80ddb5b28 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -316,15 +316,6 @@ static int passwd_abort_key(uint64_t etime) } /** - * flush_stdin() - drops all pending characters from stdin - */ -static void flush_stdin(void) -{ - while (tstc()) - (void)getchar(); -} - -/** * fallback_to_sha256() - check whether we should fall back to sha256 * password checking * @@ -354,7 +345,7 @@ static int abortboot_key_sequence(int bootdelay) uint64_t etime = endtick(bootdelay); if (IS_ENABLED(CONFIG_AUTOBOOT_FLUSH_STDIN)) - flush_stdin(); + console_flush_stdin(); # ifdef CONFIG_AUTOBOOT_PROMPT /* * CONFIG_AUTOBOOT_PROMPT includes the %d for all boards. diff --git a/common/console.c b/common/console.c index 22e554cf203..54d1249422d 100644 --- a/common/console.c +++ b/common/console.c @@ -643,6 +643,15 @@ int tstc(void) return serial_tstc(); } +/** + * console_flush_stdin() - drops all pending characters from stdin + */ +void console_flush_stdin(void) +{ + while (tstc()) + (void)getchar(); +} + #define PRE_CONSOLE_FLUSHPOINT1_SERIAL 0 #define PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL 1 @@ -914,8 +923,7 @@ int confirm_yesno(void) char str_input[5]; /* Flush input */ - while (tstc()) - getchar(); + console_flush_stdin(); i = 0; while (i < sizeof(str_input)) { str_input[i] = getchar(); |
