[PATCH] Revert "env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set"

Alex Kiernan alex.kiernan at gmail.com
Thu Aug 27 11:43:42 CEST 2020


This reverts commit 0f036bf4b87e6416f5c4d23865a62a62d9073c20.

With this change applied and CONFIG_ENV_ACCESS_IGNORE_FORCE disabled,
the warning appears on every force overwrite, but the variable is then
written to:

  => env print ethaddr
  ethaddr=00:1C:2B:08:AF:65
  => env set ethaddr 00:00:00:00:00:00
  ## Error: Can't overwrite "ethaddr"
  ## Error inserting "ethaddr" variable, errno=1
  => env print ethaddr
  ethaddr=00:1C:2B:08:AF:65
  => env set -f ethaddr 00:00:00:00:00:00
  ## Error: Can't force access to "ethaddr"
  => env print ethaddr
  ethaddr=00:00:00:00:00:00

Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---
As I noted in my email, I can't see an immediately obvious way to make
this work as intended and given we're at -rc3, I think a revert is the
most appropriate way forward.

 env/flags.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/env/flags.c b/env/flags.c
index df4aed26b2c6..4a73c31670f4 100644
--- a/env/flags.c
+++ b/env/flags.c
@@ -564,10 +564,8 @@ int env_flags_validate(const struct env_entry *item, const char *newval,
 #endif
 
 #ifndef CONFIG_ENV_ACCESS_IGNORE_FORCE
-	if (flag & H_FORCE) {
-		printf("## Error: Can't force access to \"%s\"\n", name);
+	if (flag & H_FORCE)
 		return 0;
-	}
 #endif
 	switch (op) {
 	case env_op_delete:
-- 
2.17.1



More information about the U-Boot mailing list