Redundant environment: move flag definitions to header file
authorWolfgang Denk <wd@denx.de>
Tue, 22 Jun 2010 13:44:16 +0000 (15:44 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 4 Jul 2010 21:52:42 +0000 (23:52 +0200)
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 <wd@denx.de>
common/env_eeprom.c
common/env_flash.c
include/environment.h

index 4f7f0dbdea1e4a4284317340508241f626615207..8fe59f8224b99c34cd738b1ad218f592cc335ec2 100644 (file)
 #include <i2c.h>
 #endif
 
-#ifdef CONFIG_ENV_OFFSET_REDUND
-#define ACTIVE_FLAG   1
-#define OBSOLETE_FLAG 0
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 env_t *env_ptr = NULL;
index ef0582d63266d6a32b89a2bb21e0f2092c3b94fc..925c5a02dfb32b1fd6c8b8a1c9b12761ac99b172 100644 (file)
@@ -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[];
index b9924fd7789cea1e935e22fa836341053eabd883..203f731967ef7439e401c12dfedebdedffe35aa6 100644 (file)
 
 #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