diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-12-11 22:16:21 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-13 11:46:55 -0700 |
commit | 7afcf3a55b5f484b3d3442053fae8186a3fb92d7 (patch) | |
tree | 1aa2c5143a1bbef6570b03652107a09832a2f2ad /common/env_common.c | |
parent | 3d3b52f2586a8bf1c53496547062594fd4386454 (diff) | |
download | u-boot-7afcf3a55b5f484b3d3442053fae8186a3fb92d7.tar.gz u-boot-7afcf3a55b5f484b3d3442053fae8186a3fb92d7.tar.bz2 u-boot-7afcf3a55b5f484b3d3442053fae8186a3fb92d7.zip |
env: Refactor apply into change_ok
Move the read of the old value to inside the check function. In some
cases it can be avoided all together and at the least the code is only
called from one place.
Also name the function and the callback to more clearly describe what
it does.
Pass the ENTRY instead of just the name for direct access to the whole
data structure.
Pass an enum to the callback that specifies the operation being approved.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common/env_common.c')
-rw-r--r-- | common/env_common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/env_common.c b/common/env_common.c index f22f5b968e..a960aa8033 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR; #include <env_default.h> struct hsearch_data env_htab = { - .apply = env_check_apply, + .change_ok = env_change_ok, }; static uchar __env_get_char_spec(int index) @@ -162,6 +162,7 @@ void env_relocate(void) { #if defined(CONFIG_NEEDS_MANUAL_RELOC) env_reloc(); + env_htab.change_ok += gd->reloc_off; #endif if (gd->env_valid == 0) { #if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_SPL_BUILD) |