From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] saveenv: standardize enablement
Date: Tue, 30 Dec 2008 02:59:25 -0500 [thread overview]
Message-ID: <1230623965-16546-1-git-send-email-vapier@gentoo.org> (raw)
Rather than special casing each environment type for enabling the saveenv
command, have them all behave the same. This avoids bitrot as new env
sources are added/removed.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
common/cmd_nvedit.c | 26 ++++++++------------------
1 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 85025da..b93de13 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -546,11 +546,8 @@ int getenv_r (char *name, char *buf, unsigned len)
return (-1);
}
-#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CONFIG_ENV_IS_NOWHERE))
+#if defined(CONFIG_CMD_ENV) && !defined(CONFIG_ENV_IS_NOWHERE)
+
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern char * env_name_spec;
@@ -560,6 +557,12 @@ int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return (saveenv() ? 1 : 0);
}
+U_BOOT_CMD(
+ saveenv, 1, 0, do_saveenv,
+ "saveenv - save environment variables to persistent storage\n",
+ NULL
+);
+
#endif
@@ -602,19 +605,6 @@ U_BOOT_CMD(
" - delete environment variable 'name'\n"
);
-#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CONFIG_ENV_IS_NOWHERE))
-U_BOOT_CMD(
- saveenv, 1, 0, do_saveenv,
- "saveenv - save environment variables to persistent storage\n",
- NULL
-);
-
-#endif
-
#if defined(CONFIG_CMD_ASKENV)
U_BOOT_CMD(
--
1.6.0.6
next reply other threads:[~2008-12-30 7:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 7:59 Mike Frysinger [this message]
2009-01-26 4:13 ` [U-Boot] [PATCH] saveenv: standardize enablement Mike Frysinger
2009-01-27 21:35 ` Wolfgang Denk
2009-01-28 8:17 ` Wolfgang Denk
2009-01-28 8:50 ` Mike Frysinger
2009-01-28 9:03 ` Wolfgang Denk
2009-01-28 18:48 ` [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV Mike Frysinger
2009-01-28 18:54 ` Mike Frysinger
2009-01-28 21:24 ` Wolfgang Denk
2009-01-28 21:23 ` 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=1230623965-16546-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--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