From 7b51b576d6db714e8668a98de67e93651e18123c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:46:52 -0600 Subject: env: Move env_get() to env.h Move env_get() over to the new header file. Acked-by: Joe Hershberger Signed-off-by: Simon Glass --- env/callback.c | 1 + 1 file changed, 1 insertion(+) (limited to 'env/callback.c') diff --git a/env/callback.c b/env/callback.c index 54d2de4a962..95be80d4542 100644 --- a/env/callback.c +++ b/env/callback.c @@ -5,6 +5,7 @@ */ #include +#include #include #if defined(CONFIG_NEEDS_MANUAL_RELOC) -- 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 --- env/callback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'env/callback.c') diff --git a/env/callback.c b/env/callback.c index 95be80d4542..d539da93aaa 100644 --- a/env/callback.c +++ b/env/callback.c @@ -43,7 +43,7 @@ static const char *callback_list; * This is called specifically when the variable did not exist in the hash * previously, so the blanket update did not find this variable. */ -void env_callback_init(ENTRY *var_entry) +void env_callback_init(struct env_entry *var_entry) { const char *var_name = var_entry->key; char callback_name[256] = ""; @@ -80,7 +80,7 @@ void env_callback_init(ENTRY *var_entry) * Called on each existing env var prior to the blanket update since removing * a callback association should remove its callback. */ -static int clear_callback(ENTRY *entry) +static int clear_callback(struct env_entry *entry) { entry->callback = NULL; @@ -92,7 +92,7 @@ static int clear_callback(ENTRY *entry) */ static int set_callback(const char *name, const char *value, void *priv) { - ENTRY e, *ep; + struct env_entry e, *ep; struct env_clbk_tbl *clbkp; e.key = name; -- 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 --- env/callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'env/callback.c') diff --git a/env/callback.c b/env/callback.c index d539da93aaa..d5469ce3c27 100644 --- a/env/callback.c +++ b/env/callback.c @@ -98,7 +98,7 @@ static int set_callback(const char *name, const char *value, void *priv) e.key = name; e.data = NULL; e.callback = NULL; - hsearch_r(e, FIND, &ep, &env_htab, 0); + hsearch_r(e, ENV_FIND, &ep, &env_htab, 0); /* does the env variable actually exist? */ if (ep != NULL) { -- 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 --- env/callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'env/callback.c') diff --git a/env/callback.c b/env/callback.c index d5469ce3c27..f0904cfdc53 100644 --- a/env/callback.c +++ b/env/callback.c @@ -6,7 +6,7 @@ #include #include -#include +#include #if defined(CONFIG_NEEDS_MANUAL_RELOC) DECLARE_GLOBAL_DATA_PTR; -- cgit v1.2.3