From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_nand: show nand scrub confirmation character
Date: Fri, 19 Mar 2010 17:02:11 -0500 [thread overview]
Message-ID: <20100319220211.GA8992@loki.buserror.net> (raw)
In-Reply-To: <201003191606.16508.f.fainelli@gmail.com>
On Fri, Mar 19, 2010 at 04:06:16PM +0100, Florian Fainelli wrote:
> When issuing a nand scrub command, the entered character is not displayed
> this may be confusing. This patch makes the input character being displayed
> if it is a 'y' so that an user knows he is about to scrub his nand.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 075a8af..69cc0a8 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -327,8 +327,10 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
> "are sure of what you are doing!\n"
> "\nReally scrub this NAND flash? <y/N>\n");
>
> - if (getc() == 'y' && getc() == '\r') {
> - opts.scrub = 1;
> + if (getc() == 'y') {
> + puts("y");
> + if (getc() == '\r')
> + opts.scrub = 1;
> } else {
> puts("scrub aborted\n");
> return -1;
>
You're changing the behavior in case the user presses y and then does
something other than hit return. You won't set scrub = 1, but you'll
continue with the erase rather than printing "scrub aborted" and returning.
-Scott
next prev parent reply other threads:[~2010-03-19 22:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-19 15:06 [U-Boot] [PATCH] cmd_nand: show nand scrub confirmation character Florian Fainelli
2010-03-19 22:02 ` Scott Wood [this message]
2010-03-20 18:02 ` Florian Fainelli
2010-03-23 19:31 ` Scott Wood
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=20100319220211.GA8992@loki.buserror.net \
--to=scottwood@freescale.com \
--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