From: Frank Wunderlich <frank-w@public-files.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 4/4] [RFC] env: call env_erase twice if CONFIG_ENV_OFFSET_REDUND is set
Date: Sun, 28 Apr 2019 10:51:28 +0200 [thread overview]
Message-ID: <20190428085128.8479-5-frank-w@public-files.de> (raw)
In-Reply-To: <20190428085128.8479-1-frank-w@public-files.de>
erase also the redundant environment location if offset is defined
this is a possible implementation without adding additional parameter
to env erase command
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
cmd/nvedit.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 2071bcf443..f11972e8f1 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -766,8 +766,15 @@ U_BOOT_CMD(
static int do_env_erase(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
- return env_erase(false) ? 1 : 0;
+ int ret;
+
+ ret = env_erase(false) ? 1 : 0;
+ #ifdef CONFIG_ENV_OFFSET_REDUND
+ ret = ret || (env_erase(true) ? 1 : 0);
+ #endif
+ return ret;
}
+
U_BOOT_CMD(
eraseenv, 1, 0, do_env_erase,
"erase environment variables from persistent storage",
--
2.17.1
next prev parent reply other threads:[~2019-04-28 8:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-28 8:51 [U-Boot] [PATCH v4 0/4] add command env erase Frank Wunderlich
2019-04-28 8:51 ` [U-Boot] [PATCH v4 1/4] env: register erase command Frank Wunderlich
2019-06-24 19:26 ` Simon Goldschmidt
2019-04-28 8:51 ` [U-Boot] [PATCH v4 2/4] env: mmc: add erase-function Frank Wunderlich
2019-06-24 19:40 ` Simon Goldschmidt
2019-06-24 20:08 ` Frank Wunderlich
2019-06-24 20:19 ` Simon Goldschmidt
2019-04-28 8:51 ` [U-Boot] [PATCH v4 3/4] env: add option to use redundant offset Frank Wunderlich
2019-04-28 8:51 ` Frank Wunderlich [this message]
2019-05-20 18:34 ` [U-Boot] [PATCH v4 0/4] add command env erase Frank Wunderlich
2019-06-24 10:30 ` Frank Wunderlich
2019-06-24 18:16 ` Tom Rini
2019-06-24 19:25 ` Simon Goldschmidt
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=20190428085128.8479-5-frank-w@public-files.de \
--to=frank-w@public-files.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.