diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-06-27 16:23:04 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-07-01 17:42:56 -0400 |
commit | 4632739202ae4d1f67c5591551598be0a80d501d (patch) | |
tree | 396b5f424b0a61b9947d649c122cfd646098a0b6 /common | |
parent | 09b9d9e55f64259763c20217f7743dbeec9bb055 (diff) |
autoboot: move bootdelay >= 0 check to abortboot()
Move the bootdelay >= 0 check to the caller, which simplifies
the callees.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/autoboot.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/common/autoboot.c b/common/autoboot.c index fb131395aa..c52bad84a4 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -187,9 +187,6 @@ static int __abortboot(int bootdelay) int abort; uint64_t etime = endtick(bootdelay); - if (bootdelay < 0) - return 0; - # ifdef CONFIG_AUTOBOOT_PROMPT /* * CONFIG_AUTOBOOT_PROMPT includes the %d for all boards. @@ -219,20 +216,16 @@ static int __abortboot(int bootdelay) #ifdef CONFIG_MENUPROMPT printf(CONFIG_MENUPROMPT); #else - if (bootdelay >= 0) - printf("Hit any key to stop autoboot: %2d ", bootdelay); + printf("Hit any key to stop autoboot: %2d ", bootdelay); #endif /* * Check if key already pressed - * Don't check if bootdelay < 0 */ - if (bootdelay >= 0) { - if (tstc()) { /* we got a key press */ - (void) getc(); /* consume input */ - puts("\b\b\b 0"); - abort = 1; /* don't auto boot */ - } + if (tstc()) { /* we got a key press */ + (void) getc(); /* consume input */ + puts("\b\b\b 0"); + abort = 1; /* don't auto boot */ } while ((bootdelay > 0) && (!abort)) { @@ -264,9 +257,10 @@ static int __abortboot(int bootdelay) static int abortboot(int bootdelay) { - int abort; + int abort = 0; - abort = __abortboot(bootdelay); + if (bootdelay >= 0) + abort = __abortboot(bootdelay); #ifdef CONFIG_SILENT_CONSOLE if (abort) |