summaryrefslogtreecommitdiff
path: root/env/sf.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-01 09:47:08 -0600
committerTom Rini <trini@konsulko.com>2019-08-11 16:43:41 -0400
commitd3716dd64bb8bb4c4ba2d19bac164d24ada72a68 (patch)
tree0813ae10d149c97f5dedb88624366dff087dcd05 /env/sf.c
parent25e51e90feec10b7d534b123cd9c4ed7a3a2dc1a (diff)
env: Rename the redundancy flags
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to env.h since they are part of the public API. Use an enum rather than a #define to tie them together. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'env/sf.c')
-rw-r--r--env/sf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/env/sf.c b/env/sf.c
index 5531293e05..09646e1eed 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;
static ulong env_new_offset = CONFIG_ENV_OFFSET_REDUND;
#endif
-#define ACTIVE_FLAG 1
-#define OBSOLETE_FLAG 0
#endif /* CONFIG_ENV_OFFSET_REDUND */
DECLARE_GLOBAL_DATA_PTR;
@@ -74,7 +72,7 @@ static int setup_flash_device(void)
static int env_sf_save(void)
{
env_t env_new;
- char *saved_buffer = NULL, flag = OBSOLETE_FLAG;
+ char *saved_buffer = NULL, flag = ENV_REDUND_OBSOLETE;
u32 saved_size, saved_offset, sector;
int ret;
@@ -85,7 +83,7 @@ static int env_sf_save(void)
ret = env_export(&env_new);
if (ret)
return -EIO;
- env_new.flags = ACTIVE_FLAG;
+ env_new.flags = ENV_REDUND_ACTIVE;
if (gd->env_valid == ENV_VALID) {
env_new_offset = CONFIG_ENV_OFFSET_REDUND;