diff options
author | Martin Fuzzey <martin.fuzzey@flowbird.group> | 2021-01-11 13:27:20 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-04-16 18:55:55 +0300 |
commit | 9636bf8b2e319c0f43453f71131ba70856571d05 (patch) | |
tree | ce238023dc6e47424d5e9780ae16900b861a5da9 /env/Kconfig | |
parent | b9c3052fbb25bff26702e6c16abfd0a5ec92040c (diff) | |
download | u-boot-9636bf8b2e319c0f43453f71131ba70856571d05.tar.xz |
env: Fix warning when forcing environment without ENV_ACCESS_IGNORE_FORCE
Since commit 0f036bf4b87e ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set")
a warning message is displayed when setenv -f is used WITHOUT
CONFIG_ENV_ACCESS_IGNORE_FORCE, but the variable is set anyway, resulting
in lots of log pollution.
env_flags_validate() returns 0 if the access is accepted, or non zero
if it is refused.
So the original code
#ifndef CONFIG_ENV_ACCESS_IGNORE_FORCE
if (flag & H_FORCE)
return 0;
#endif
was correct, it returns 0 (accepts the modification) if forced UNLESS
IGNORE_FORCE is set (in which case access checks in the following code
are applied). The broken patch just added a printf to the force accepted
case.
To obtain the intent of the patch we need this:
if (flag & H_FORCE) {
#ifdef CONFIG_ENV_ACCESS_IGNORE_FORCE
printf("## Error: Can't force access to \"%s\"\n", name);
#else
return 0;
#endif
}
Fixes: 0f036bf4b87e ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set")
Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Diffstat (limited to 'env/Kconfig')
0 files changed, 0 insertions, 0 deletions