X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=env%2Fcallback.c;h=4054b9ef58b3a25fda8371938b3c904e0f573ce4;hb=1d0adee45cc2d3257c926d6022bf1922805b928e;hp=be70980f04e46c8efac81a6dbbbdaba7a1f8abfe;hpb=470135be276b2d92c6da464c68839202d4ff0d08;p=oweals%2Fu-boot.git diff --git a/env/callback.c b/env/callback.c index be70980f04..4054b9ef58 100644 --- a/env/callback.c +++ b/env/callback.c @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2012 * Joe Hershberger, National Instruments, joe.hershberger@ni.com - * - * SPDX-License-Identifier: GPL-2.0+ */ #include -#include +#include +#include #if defined(CONFIG_NEEDS_MANUAL_RELOC) DECLARE_GLOBAL_DATA_PTR; @@ -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] = ""; @@ -55,6 +55,8 @@ void env_callback_init(ENTRY *var_entry) first_call = 0; } + var_entry->callback = NULL; + /* look in the ".callbacks" var for a reference to this variable */ if (callback_list != NULL) ret = env_attr_lookup(callback_list, var_name, callback_name); @@ -80,7 +82,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,13 +94,13 @@ 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; 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) {