From cdbff9fc4002fdd47181088d5abe90e5f2fa1904 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:46:50 -0600 Subject: [PATCH] env: Move env_get_hex() to env.h Move env_get_hex() over to the new header file. Signed-off-by: Simon Glass Acked-by: Joe Hershberger --- arch/x86/lib/zimage.c | 1 + cmd/elf.c | 1 + common/image-fdt.c | 1 + include/common.h | 12 ------------ include/env.h | 12 ++++++++++++ 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 230b38e938..6a6258a505 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include diff --git a/cmd/elf.c b/cmd/elf.c index d883be4193..5e5cf47cf8 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/common/image-fdt.c b/common/image-fdt.c index e70da3dcb3..4247dcee0c 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/include/common.h b/include/common.h index 83050073bf..8d8bbc4da3 100644 --- a/include/common.h +++ b/include/common.h @@ -157,18 +157,6 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []); */ char *env_get(const char *varname); -/** - * env_get_hex() - Return an environment variable as a hex value - * - * Decode an environment as a hex number (it may or may not have a 0x - * prefix). If the environment variable cannot be found, or does not start - * with hex digits, the default value is returned. - * - * @varname: Variable to decode - * @default_val: Value to return on error - */ -ulong env_get_hex(const char *varname, ulong default_val); - /** * env_set() - set an environment variable * diff --git a/include/env.h b/include/env.h index d7190da335..dd063feb39 100644 --- a/include/env.h +++ b/include/env.h @@ -93,6 +93,18 @@ ulong env_get_ulong(const char *name, int base, ulong default_val); */ int env_set_ulong(const char *varname, ulong value); +/** + * env_get_hex() - Return an environment variable as a hex value + * + * Decode an environment as a hex number (it may or may not have a 0x + * prefix). If the environment variable cannot be found, or does not start + * with hex digits, the default value is returned. + * + * @varname: Variable to decode + * @default_val: Value to return on error + */ +ulong env_get_hex(const char *varname, ulong default_val); + /** * env_set_hex() - set an environment variable to a hex value * -- 2.39.5