mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
make env_entry::callback conditional on !CONFIG_SPL_BUILD
The callback member of struct env_entry is always NULL for an SPL build. Removing it thus saves a bit of run-time memory in the SPL (when CONFIG_SPL_ENV_SUPPORT=y) since struct env_entry is embedded in struct env_entry_node - i.e. about 2KB for the normal case of 512+change hash table entries. Two small fixups are needed for this, all other references to the callback member are already under !CONFIG_SPL_BUILD: Don't initialize .callback in set_flags() - hsearch_r doesn't use that value anyway. And make env_callback_init() initialize ->callback to NULL for a new entry instead of relying on an unused or deleted entry having NULL in ->callback. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
34284970a1
commit
080019b86c
4 changed files with 4 additions and 2 deletions
1
env/flags.c
vendored
1
env/flags.c
vendored
|
@ -457,7 +457,6 @@ static int set_flags(const char *name, const char *value, void *priv)
|
|||
|
||||
e.key = name;
|
||||
e.data = NULL;
|
||||
e.callback = NULL;
|
||||
hsearch_r(e, ENV_FIND, &ep, &env_htab, 0);
|
||||
|
||||
/* does the env variable actually exist? */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue