diff options
author | Patrice Chotard <patrice.chotard@st.com> | 2019-11-25 11:07:36 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-07 00:44:18 +0300 |
commit | 1ac2cb974142132d9bfd988e6a8702d7a66958e0 (patch) | |
tree | f1f0b21202eb59c0af89649a9f2a89e6082822f9 /cmd | |
parent | bead4f2f2c85e1bf39d2c80ef733f1325eb336bb (diff) | |
download | u-boot-1ac2cb974142132d9bfd988e6a8702d7a66958e0.tar.xz |
cmd: Migrate from_env() from pxe.c to nvedit.c
Migrate from_env() from pxe.c to nvedit.c as it's not pxe specific.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/nvedit.c | 17 | ||||
-rw-r--r-- | cmd/pxe.c | 17 |
2 files changed, 17 insertions, 17 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index b5da375913..3420e0b985 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -682,6 +682,23 @@ char *env_get(const char *name) } /* + * Like env_get, but prints an error if envvar isn't defined in the + * environment. It always returns what env_get does, so it can be used in + * place of env_get without changing error handling otherwise. + */ +char *from_env(const char *envvar) +{ + char *ret; + + ret = env_get(envvar); + + if (!ret) + printf("missing environment variable: %s\n", envvar); + + return ret; +} + +/* * Look up variable from environment for restricted C runtime env. */ int env_get_f(const char *name, char *buf, unsigned len) @@ -37,23 +37,6 @@ const char *pxe_default_paths[] = { static bool is_pxe; -/* - * Like env_get, but prints an error if envvar isn't defined in the - * environment. It always returns what env_get does, so it can be used in - * place of env_get without changing error handling otherwise. - */ -static char *from_env(const char *envvar) -{ - char *ret; - - ret = env_get(envvar); - - if (!ret) - printf("missing environment variable: %s\n", envvar); - - return ret; -} - #ifdef CONFIG_CMD_NET /* * Convert an ethaddr from the environment to the format used by pxelinux |