mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 00:32:04 +02:00
autoboot: Adjust the implementation in autoboot_command()
Avoid use of #ifdef and keep the common condion in a variable. This makes the code easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -349,15 +349,18 @@ void autoboot_command(const char *s)
|
|||||||
debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
||||||
|
|
||||||
if (stored_bootdelay != -1 && s && !abortboot(stored_bootdelay)) {
|
if (stored_bootdelay != -1 && s && !abortboot(stored_bootdelay)) {
|
||||||
#if defined(CONFIG_AUTOBOOT_KEYED) && !defined(CONFIG_AUTOBOOT_KEYED_CTRLC)
|
bool lock;
|
||||||
int prev = disable_ctrlc(1); /* disable Control C checking */
|
int prev;
|
||||||
#endif
|
|
||||||
|
lock = IS_ENABLED(CONFIG_AUTOBOOT_KEYED) &&
|
||||||
|
!IS_ENABLED(CONFIG_AUTOBOOT_KEYED_CTRLC);
|
||||||
|
if (lock)
|
||||||
|
prev = disable_ctrlc(1); /* disable Ctrl-C checking */
|
||||||
|
|
||||||
run_command_list(s, -1, 0);
|
run_command_list(s, -1, 0);
|
||||||
|
|
||||||
#if defined(CONFIG_AUTOBOOT_KEYED) && !defined(CONFIG_AUTOBOOT_KEYED_CTRLC)
|
if (lock)
|
||||||
disable_ctrlc(prev); /* restore Control C checking */
|
disable_ctrlc(prev); /* restore Ctrl-C checking */
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_USE_AUTOBOOT_MENUKEY) &&
|
if (IS_ENABLED(CONFIG_USE_AUTOBOOT_MENUKEY) &&
|
||||||
|
Reference in New Issue
Block a user