From: Wolfgang Denk Date: Tue, 22 Jun 2010 13:44:16 +0000 (+0200) Subject: Redundant environment: move flag definitions to header file X-Git-Tag: v2010.09-rc1~93 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b218ccb5435e64ac2318bb8b6c9594ef1cc724cd;p=oweals%2Fu-boot.git Redundant environment: move flag definitions to header file Instead of defining the flags sevaral times in different source files (which is error prone), move them to a central place in a header file. Signed-off-by: Wolfgang Denk --- diff --git a/common/env_eeprom.c b/common/env_eeprom.c index 4f7f0dbdea..8fe59f8224 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -32,11 +32,6 @@ #include #endif -#ifdef CONFIG_ENV_OFFSET_REDUND -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0 -#endif - DECLARE_GLOBAL_DATA_PTR; env_t *env_ptr = NULL; diff --git a/common/env_flash.c b/common/env_flash.c index ef0582d632..925c5a02df 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -71,9 +71,6 @@ static env_t *flash_addr_new = (env_t *)CONFIG_ENV_ADDR_REDUND; /* CONFIG_ENV_ADDR is supposed to be on sector boundary */ static ulong end_addr = CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1; static ulong end_addr_new = CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1; - -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0 #endif /* CONFIG_ENV_ADDR_REDUND */ extern uchar default_environment[]; diff --git a/include/environment.h b/include/environment.h index b9924fd778..203f731967 100644 --- a/include/environment.h +++ b/include/environment.h @@ -122,6 +122,9 @@ #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