env: Add an enum for environment state

At present we have three states for the environment, numbered 0, 1 and 2.
Add an enum to record this to avoid open-coded values.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Simon Glass
2017-08-03 12:21:56 -06:00
committed by Tom Rini
parent 75de597d2d
commit 203e94f6c9
28 changed files with 104 additions and 83 deletions

2
env/nvram.c vendored
View File

@@ -104,7 +104,7 @@ int env_init(void)
if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
gd->env_addr = (ulong)&env_ptr->data;
#endif
gd->env_valid = 1;
gd->env_valid = ENV_VALID;
} else {
gd->env_addr = (ulong)&default_environment[0];
gd->env_valid = 0;