From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/6] Redundant environment: move flag definitions to header file
Date: Thu, 24 Jun 2010 00:06:13 +0200 [thread overview]
Message-ID: <1277330773-28395-7-git-send-email-wd@denx.de> (raw)
In-Reply-To: <1277330773-28395-1-git-send-email-wd@denx.de>
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 | 5 -----
common/env_flash.c | 3 ---
include/environment.h | 3 +++
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/common/env_eeprom.c b/common/env_eeprom.c
index 4f7f0db..8fe59f8 100644
--- a/common/env_eeprom.c
+++ b/common/env_eeprom.c
@@ -32,11 +32,6 @@
#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;
diff --git a/common/env_flash.c b/common/env_flash.c
index ef0582d..925c5a0 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 b9924fd..203f731 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
--
1.7.0.1
next prev parent reply other threads:[~2010-06-23 22:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 22:06 [U-Boot] [PATCH 0/6] misc fixes / cleanups Wolfgang Denk
2010-06-23 22:06 ` [U-Boot] [PATCH 1/6] boards.cfg: fix board directory name for ML2 board Wolfgang Denk
2010-06-23 22:06 ` [U-Boot] [PATCH 2/6] shannon/INFERNO: fix special handling of environment configuration Wolfgang Denk
2010-07-04 21:49 ` Wolfgang Denk
2010-06-23 22:06 ` [U-Boot] [PATCH 3/6] cmd_ide.c: fix unused variable warning for SC3 board Wolfgang Denk
2010-07-04 21:49 ` Wolfgang Denk
2010-06-23 22:06 ` [U-Boot] [PATCH 4/6] exports.c: fix warning: 'dummy' defined but not used Wolfgang Denk
2010-06-23 23:32 ` Mike Frysinger
2010-06-29 9:52 ` [U-Boot] [PATCH 4/6 v2] " Wolfgang Denk
2010-06-29 20:00 ` Mike Frysinger
2010-06-29 21:07 ` Wolfgang Denk
2010-06-30 22:44 ` [U-Boot] [PATCH 4/6 v3] " Wolfgang Denk
2010-06-30 23:04 ` Mike Frysinger
2010-07-01 7:30 ` Wolfgang Denk
2010-07-01 7:31 ` [U-Boot] [PATCH 4/6 v4] " Wolfgang Denk
2010-07-04 21:51 ` Wolfgang Denk
2010-06-23 22:06 ` [U-Boot] [PATCH 5/6] Make *printf() return "int" instead of "void" Wolfgang Denk
2010-07-04 21:52 ` Wolfgang Denk
2010-06-23 22:06 ` Wolfgang Denk [this message]
2010-07-04 21:52 ` [U-Boot] [PATCH 6/6] Redundant environment: move flag definitions to header file Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277330773-28395-7-git-send-email-wd@denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox