Patchwork nanddump: Rename --nobad to --noskipbad

login
register
mail settings
Submitter Wolfram Sang
Date Sept. 13, 2010, 7:15 a.m.
Message ID <1284362113-26737-1-git-send-email-w.sang@pengutronix.de>
Download mbox | patch
Permalink /patch/64575/
State Accepted
Commit c9bdc0ca41b8ca9658d6ec7e22b2fd708a450b67
Headers show

Comments

Wolfram Sang - Sept. 13, 2010, 7:15 a.m.
"nobad" might lead to the assumption that bad blocks are skipped, but this
option does exactly the opposite. Use a more descriptive name.

Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Mike Frysinger <vapier@gentoo.org>
---

Build tested only.

 nanddump.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
Artem Bityutskiy - Sept. 17, 2010, 6:20 a.m.
On Mon, 2010-09-13 at 09:15 +0200, Wolfram Sang wrote:
> "nobad" might lead to the assumption that bad blocks are skipped, but this
> option does exactly the opposite. Use a more descriptive name.
> 
> Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Mike Frysinger <vapier@gentoo.org>

It does not apply to the latest mtd-utils tree. Would you please re-send
an updated version?
Wolfram Sang - Sept. 17, 2010, 7:54 a.m.
On Fri, Sep 17, 2010 at 09:20:20AM +0300, Artem Bityutskiy wrote:
> On Mon, 2010-09-13 at 09:15 +0200, Wolfram Sang wrote:
> > "nobad" might lead to the assumption that bad blocks are skipped, but this
> > option does exactly the opposite. Use a more descriptive name.
> > 
> > Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk>
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Mike Frysinger <vapier@gentoo.org>
> 
> It does not apply to the latest mtd-utils tree. Would you please re-send
> an updated version?

Ehrm, it still applies on top of Mike's original patch (it just seems
that the latter is not pushed yet despite your mail saying so). Or do
you want me to fold those two?

Regards,

   Wolfram
Artem Bityutskiy - Sept. 17, 2010, 8:24 a.m.
On Fri, 2010-09-17 at 09:54 +0200, Wolfram Sang wrote:
> On Fri, Sep 17, 2010 at 09:20:20AM +0300, Artem Bityutskiy wrote:
> > On Mon, 2010-09-13 at 09:15 +0200, Wolfram Sang wrote:
> > > "nobad" might lead to the assumption that bad blocks are skipped, but this
> > > option does exactly the opposite. Use a more descriptive name.
> > > 
> > > Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk>
> > > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > > Cc: Mike Frysinger <vapier@gentoo.org>
> > 
> > It does not apply to the latest mtd-utils tree. Would you please re-send
> > an updated version?
> 
> Ehrm, it still applies on top of Mike's original patch (it just seems
> that the latter is not pushed yet despite your mail saying so). Or do
> you want me to fold those two?

Indeed forgot to push it out, sorry. No, I'll sort this out, thanks.
Artem Bityutskiy - Sept. 18, 2010, 5:16 p.m.
On Mon, 2010-09-13 at 09:15 +0200, Wolfram Sang wrote:
> "nobad" might lead to the assumption that bad blocks are skipped, but this
> option does exactly the opposite. Use a more descriptive name.
> 
> Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Mike Frysinger <vapier@gentoo.org>

Pushed to mtd-2.6.git, thanks!

Patch

diff --git a/nanddump.c b/nanddump.c
index 8b3d4a1..709b2db 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -50,7 +50,7 @@  static void display_help (void)
 "-f file    --file=file          Dump to file\n"
 "-l length  --length=length      Length\n"
 "-n         --noecc              Read without error correction\n"
-"-N         --nobad              Read without bad block skipping\n"
+"-N         --noskipbad          Read without bad block skipping\n"
 "-o         --omitoob            Omit oob data\n"
 "-b         --omitbad            Omit bad blocks from the dump\n"
 "-p         --prettyprint        Print nice (hexdump)\n"
@@ -77,7 +77,7 @@  static void display_version (void)
 
 static bool		pretty_print = false;	// print nice
 static bool		noecc = false;		// don't error correct
-static bool		nobad = false;		// don't skip bad blocks
+static bool		noskipbad = false;	// don't skip bad blocks
 static bool		omitoob = false;	// omit oob data
 static unsigned long	start_addr;		// start address
 static unsigned long	length;			// dump length
@@ -107,7 +107,7 @@  static void process_options (int argc, char * const argv[])
 			{"startaddress", required_argument, 0, 's'},
 			{"length", required_argument, 0, 'l'},
 			{"noecc", no_argument, 0, 'n'},
-			{"nobad", no_argument, 0, 'N'},
+			{"noskipbad", no_argument, 0, 'N'},
 			{"quiet", no_argument, 0, 'q'},
 			{0, 0, 0, 0},
 		};
@@ -162,7 +162,7 @@  static void process_options (int argc, char * const argv[])
 				noecc = true;
 				break;
 			case 'N':
-				nobad = true;
+				noskipbad = true;
 				break;
 			case '?':
 				error++;
@@ -396,7 +396,7 @@  int main(int argc, char * const argv[])
 	for (ofs = start_addr; ofs < end_addr ; ofs+=bs) {
 
 		// new eraseblock , check for bad block
-		if (nobad) {
+		if (noskipbad) {
 			badblock = 0;
 		} else if (blockstart != (ofs & (~meminfo.erasesize + 1))) {
 			blockstart = ofs & (~meminfo.erasesize + 1);