public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] add explicit bbt creation to commandline
Date: Sun, 6 Jul 2008 13:16:20 +0200	[thread overview]
Message-ID: <20080706111620.GC13922@game.jcrosoft.org> (raw)
In-Reply-To: <20080706080456.GF4167@prithivi.gnumonks.org>

On 16:04 Sun 06 Jul     , Harald Welte wrote:
> [PATCH] add explicit bbt creation to commandline ("nand createbbt" command)
> 
> This patch adds user-requested BBT creation. It includes the following changes:
>     
> - common/cmd_nand.c: move yes/no decision to separate function
> - do_nand: ask for confirmation for "nand erase"
> - do_nand: add command "nand createbbt" to erase NAND and create a new BBT
>     
> Signed-off-by: Werner Almesberger <werner@openmoko.org>
> Signed-off-by: Harald Welte <laforge@openmoko.org>
> 
> ---
> 
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index bb46f34..2f41157 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -162,6 +162,17 @@ out:
>  	return 0;
>  }
>  
> +static int yes(void)
> +{
> +	char c;
> +
> +	c = getc();
> +	if (c != 'y' && c != 'Y')
> +		return 0;
> +	c = getc();
> +	return c == '\r' || c == '\n';
> +}
> +
It will be good to have it in a re-usable header as inline.

And why not name it as "ask_confirm()"?

Best Regards,
J.

  reply	other threads:[~2008-07-06 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06  8:04 [U-Boot-Users] [PATCH] add explicit bbt creation to commandline Harald Welte
2008-07-06 11:16 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2008-07-06 13:31   ` Wolfgang Denk
2008-07-07 18:39 ` Scott Wood
2010-02-12  2:49 ` [U-Boot] " Steven Zedeck
2010-02-12 17:04   ` Scott Wood
2010-02-12 17:38     ` Steven Zedeck
2010-02-12 17:48       ` Scott Wood
2010-02-12 18:47         ` Steven Zedeck
2010-02-12 18:53           ` Scott Wood
2010-02-12 19:18             ` Steven Zedeck
2010-02-12 19:36               ` Steven Zedeck
2010-02-12 21:23                 ` Scott Wood
2010-02-13  2:14                   ` Steven Zedeck
2010-02-16 18:35                     ` Scott Wood
2010-02-17 15:38                       ` Steven Zedeck
2010-02-17 19:10                         ` 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=20080706111620.GC13922@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.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