autoboot: Rework CONFIG_AUTOBOOT_STOP_STR_* usage

In order to not define a CONFIG value when the
CONFIG_AUTOBOOT_STOP_STR_* functionality is not enabled, rework the
assignment of empty and unused (as the code will be discarded under if
0, in the end) values to be AUTOBOOT_STOP_STR_* instead of
CONFIG_AUTOBOOT_STOP_STR_*.

Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Tom Rini 2023-01-10 11:19:34 -05:00
parent 1c88640fc8
commit d35e44fbe7

View file

@ -40,11 +40,15 @@ DECLARE_GLOBAL_DATA_PTR;
static int stored_bootdelay; static int stored_bootdelay;
static int menukey; static int menukey;
#if !defined(CONFIG_AUTOBOOT_STOP_STR_CRYPT) #if defined(CONFIG_AUTOBOOT_STOP_STR_CRYPT)
#define CONFIG_AUTOBOOT_STOP_STR_CRYPT "" #define AUTOBOOT_STOP_STR_CRYPT CONFIG_AUTOBOOT_STOP_STR_CRYPT
#else
#define AUTOBOOT_STOP_STR_CRYPT ""
#endif #endif
#if !defined(CONFIG_AUTOBOOT_STOP_STR_SHA256) #if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256)
#define CONFIG_AUTOBOOT_STOP_STR_SHA256 "" #define AUTOBOOT_STOP_STR_SHA256 CONFIG_AUTOBOOT_STOP_STR_SHA256
#else
#define AUTOBOOT_STOP_STR_SHA256 ""
#endif #endif
#ifdef CONFIG_AUTOBOOT_USE_MENUKEY #ifdef CONFIG_AUTOBOOT_USE_MENUKEY
@ -81,7 +85,7 @@ static int passwd_abort_crypt(uint64_t etime)
int err; int err;
if (IS_ENABLED(CONFIG_AUTOBOOT_STOP_STR_ENABLE) && !crypt_env_str) if (IS_ENABLED(CONFIG_AUTOBOOT_STOP_STR_ENABLE) && !crypt_env_str)
crypt_env_str = CONFIG_AUTOBOOT_STOP_STR_CRYPT; crypt_env_str = AUTOBOOT_STOP_STR_CRYPT;
if (!crypt_env_str) if (!crypt_env_str)
return 0; return 0;
@ -160,7 +164,7 @@ static int passwd_abort_sha256(uint64_t etime)
int ret; int ret;
if (sha_env_str == NULL) if (sha_env_str == NULL)
sha_env_str = CONFIG_AUTOBOOT_STOP_STR_SHA256; sha_env_str = AUTOBOOT_STOP_STR_SHA256;
presskey = malloc_cache_aligned(DELAY_STOP_STR_MAX_LENGTH); presskey = malloc_cache_aligned(DELAY_STOP_STR_MAX_LENGTH);
c = strstr(sha_env_str, ":"); c = strstr(sha_env_str, ":");