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>
This commit is contained in:
Simon Glass
2019-08-01 09:47:08 -06:00
committed by Tom Rini
parent 25e51e90fe
commit d3716dd64b
7 changed files with 39 additions and 31 deletions

View File

@@ -55,6 +55,12 @@ struct env_clbk_tbl {
{#name, callback}
#endif
/** enum env_redund_flags - Flags for the redundand_environment */
enum env_redund_flags {
ENV_REDUND_OBSOLETE = 0,
ENV_REDUND_ACTIVE = 1,
};
/**
* env_get_id() - Gets a sequence number for the environment
*

View File

@@ -135,9 +135,6 @@ extern unsigned long nand_env_oob_offset;
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
# define ENV_HEADER_SIZE (sizeof(uint32_t) + 1)
# define ACTIVE_FLAG 1
# define OBSOLETE_FLAG 0
#else
# define ENV_HEADER_SIZE (sizeof(uint32_t))
#endif
@@ -147,7 +144,7 @@ extern unsigned long nand_env_oob_offset;
typedef struct environment_s {
uint32_t crc; /* CRC32 over data bytes */
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
unsigned char flags; /* active/obsolete flags */
unsigned char flags; /* active/obsolete flags ENVF_REDUND_ */
#endif
unsigned char data[ENV_SIZE]; /* Environment data */
} env_t;