summaryrefslogtreecommitdiff
path: root/lib/hashtable.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-12-07 17:16:23 -0500
committerTom Rini <trini@konsulko.com>2020-12-07 17:16:23 -0500
commitcd833de0593fa2346dddab21eff6ccf2411380d3 (patch)
treef87835b392c62414199e5fb926d0f4f63d92ec9e /lib/hashtable.c
parent5157ea526142ace7b0b19939b0d31ace4276cda7 (diff)
parent51bb33846ad2b045799d2c43ca773fafa36e6ec8 (diff)
Merge branch '2020-12-07-bootm-and-spl-atf-improvements' into next
- Series to improve "bootm" by allowing variable evaluation within the cmdline we would be passing. This will help with Chrome OS but can be useful elsewhere. - Improve ATF (TF-A) support within SPL.
Diffstat (limited to 'lib/hashtable.c')
-rw-r--r--lib/hashtable.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/hashtable.c b/lib/hashtable.c
index 7c08f5c8055..ff5ff726394 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -472,7 +472,7 @@ int hdelete_r(const char *key, struct hsearch_data *htab, int flag)
idx = hsearch_r(e, ENV_FIND, &ep, htab, 0);
if (idx == 0) {
__set_errno(ESRCH);
- return 0; /* not found */
+ return -ENOENT; /* not found */
}
/* Check for permission */
@@ -481,7 +481,7 @@ int hdelete_r(const char *key, struct hsearch_data *htab, int flag)
debug("change_ok() rejected deleting variable "
"%s, skipping it!\n", key);
__set_errno(EPERM);
- return 0;
+ return -EPERM;
}
/* If there is a callback, call it */
@@ -490,12 +490,12 @@ int hdelete_r(const char *key, struct hsearch_data *htab, int flag)
debug("callback() rejected deleting variable "
"%s, skipping it!\n", key);
__set_errno(EINVAL);
- return 0;
+ return -EINVAL;
}
_hdelete(key, htab, ep, idx);
- return 1;
+ return 0;
}
#if !(defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SAVEENV))
@@ -917,7 +917,7 @@ int himport_r(struct hsearch_data *htab,
if (!drop_var_from_set(name, nvars, localvars))
continue;
- if (hdelete_r(name, htab, flag) == 0)
+ if (hdelete_r(name, htab, flag))
debug("DELETE ERROR ##############################\n");
continue;
@@ -979,7 +979,7 @@ int himport_r(struct hsearch_data *htab,
* b) if the variable was not present in current env, we notify
* it might be a typo
*/
- if (hdelete_r(localvars[i], htab, flag) == 0)
+ if (hdelete_r(localvars[i], htab, flag))
printf("WARNING: '%s' neither in running nor in imported env!\n", localvars[i]);
else
printf("WARNING: '%s' not in imported env, deleting it!\n", localvars[i]);