From c7694dd4837ba12db3bcda872a1047a44566e0e8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:46:46 -0600 Subject: env: Move env_set_hex() to env.h Move env_set_hex() over to the new header file along with env_set_addr() which uses it. Signed-off-by: Simon Glass Acked-by: Joe Hershberger --- api/api.c | 1 + 1 file changed, 1 insertion(+) (limited to 'api/api.c') diff --git a/api/api.c b/api/api.c index 9f03f1a35bb..8a41b7cce77 100644 --- a/api/api.c +++ b/api/api.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From dd2408cac1ea0f5e9ab4b07539c6edaee57918cb Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 Aug 2019 09:44:18 -0600 Subject: env: Drop the ENTRY typedef U-Boot is not supposed to use typedef for structs anymore. Also this name is the same as the ENTRY() macro used in assembler files, and 'entry' itself is widely used in U-Boot (>8k matches). Drop the typedef and rename the struct to env_entry to reduce confusion. Signed-off-by: Simon Glass Acked-by: Joe Hershberger --- api/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/api.c') diff --git a/api/api.c b/api/api.c index 8a41b7cce77..a0fc62ca9e5 100644 --- a/api/api.c +++ b/api/api.c @@ -497,7 +497,7 @@ static int API_env_enum(va_list ap) { int i, buflen; char *last, **next, *s; - ENTRY *match, search; + struct env_entry *match, search; static char *var; last = (char *)va_arg(ap, unsigned long); -- cgit v1.2.3 From 3f0d6807459bb22431e5bc19e597c1786b3d1ce6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:47:09 -0600 Subject: env: Drop the ACTION typedef Avoid using a typedef here which is unnecessary. Add an 'env_' prefix to both the enum and its members to make it clear that these are related to the environment. Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to env.h since they are part of the public API. Use an enum rather than a #define to tie them together. Signed-off-by: Simon Glass --- api/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/api.c') diff --git a/api/api.c b/api/api.c index a0fc62ca9e5..cd7487fde26 100644 --- a/api/api.c +++ b/api/api.c @@ -514,7 +514,7 @@ static int API_env_enum(va_list ap) if (s != NULL) *s = 0; search.key = var; - i = hsearch_r(search, FIND, &match, &env_htab, 0); + i = hsearch_r(search, ENV_FIND, &match, &env_htab, 0); if (i == 0) { i = API_EINVAL; goto done; -- cgit v1.2.3 From f3998fdc4d0871727d7be6838bac750c6323c0a8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 Aug 2019 09:44:25 -0600 Subject: env: Rename environment.h to env_internal.h This file contains lots of internal details about the environment. Most code can include env.h instead, calling the functions there as needed. Rename this file and add a comment at the top to indicate its internal nature. Signed-off-by: Simon Glass Acked-by: Joe Hershberger Reviewed-by: Simon Goldschmidt [trini: Fixup apalis-tk1.c] Signed-off-by: Tom Rini --- api/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/api.c') diff --git a/api/api.c b/api/api.c index cd7487fde26..bc9454eb4b6 100644 --- a/api/api.c +++ b/api/api.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include -- cgit v1.2.3