diff options
author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2024-01-17 18:59:12 +0100 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2024-01-19 10:57:36 +0800 |
commit | 87d3c472a266261642ad26a3d4b040de09edac71 (patch) | |
tree | 09ed1fb6b3b52ef7fc4fb58620d7e5612590a6d9 /env | |
parent | 23c1ab92be6332fb528efc2d549898a5f1d17bf9 (diff) | |
download | u-boot-87d3c472a266261642ad26a3d4b040de09edac71.zip u-boot-87d3c472a266261642ad26a3d4b040de09edac71.tar.gz u-boot-87d3c472a266261642ad26a3d4b040de09edac71.tar.bz2 |
env: migrate env_get_default to call env_get_default_into
Since both functions share a similar goal and env_get_default_into can
do what env_get_default wants to do with specific arguments, let's make
env_get_default call env_get_default_into so as to avoid code
duplication.
Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Diffstat (limited to 'env')
-rw-r--r-- | env/common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/env/common.c b/env/common.c index ebcb108..beebbd1 100644 --- a/env/common.c +++ b/env/common.c @@ -351,9 +351,11 @@ bool env_get_autostart(void) */ char *env_get_default(const char *name) { - if (env_get_from_linear(default_environment, name, - (char *)(gd->env_buf), - sizeof(gd->env_buf)) >= 0) + int ret; + + ret = env_get_default_into(name, (char *)(gd->env_buf), + sizeof(gd->env_buf)); + if (ret >= 0) return (char *)(gd->env_buf); return NULL; |