Skip to content

Commit

Permalink
nanddump: kill --omitbad, --noskipbad
Browse files Browse the repository at this point in the history
As mentioned previously, we are killing --omitbad in favor of the new
--bb=skipbad option, which functions fairly similarly. Also, --noskipbad
has become --bb=dumpbad, so remove the old `-N' and `--noskipbad' flags.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
computersforpeace authored and Artem Bityutskiy committed Jun 25, 2011
1 parent 5319b84 commit d8b8f78
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions nanddump.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,6 @@ static void display_help(void)
" dumpbad: dump flash data, including any bad blocks\n"
" skipbad: dump good data, completely skipping any bad blocks\n"
"\n"
"Deprecated options:\n"
"The following options are being replaced by --bb=METHOD flags or being\n"
"removed entirely. Do not continue to use these options.\n"
"-b --omitbad Omit bad blocks from the dump (DEPRECATED)\n"
"-N --noskipbad Read without bad block skipping\n"
"\n"
"Notes on --omitbad and --bb=skipbad:\n"
"* `omitbad' and `skipbad' are very similar; we are deprecating `--omitbad'\n"
" in favor of `--bb=skipbad'.\n"
"* With either option, we stop dumping data when we encounter a bad block\n"
" and resume dumping at the next good block. However, with `omitbad', we\n"
" count the bad block as part of the total dump length, whereas with\n"
" `skipbad', the bad block is skipped, that is, not counted toward the\n"
" total dump length.\n"
"\n"
"Note on --oob, --omitoob:\n"
" To make nanddump act more like an inverse to nandwrite, we are changing\n"
" the default OOB behavior. In the next release, nanddump will not dump\n"
Expand Down Expand Up @@ -120,7 +105,6 @@ static enum {
padbad, // dump flash data, substituting 0xFF for any bad blocks
dumpbad, // dump flash data, including any bad blocks
skipbad, // dump good data, completely skipping any bad blocks
omitbad // dump flash data, substituting nothing for any bad blocks (DEPRECATED)
} bb_method = padbad;

static void process_options(int argc, char * const argv[])
Expand All @@ -130,7 +114,7 @@ static void process_options(int argc, char * const argv[])

for (;;) {
int option_index = 0;
static const char *short_options = "bs:f:l:opqnNca";
static const char *short_options = "s:f:l:opqnca";
static const struct option long_options[] = {
{"help", no_argument, 0, 0},
{"version", no_argument, 0, 0},
Expand All @@ -141,11 +125,9 @@ static void process_options(int argc, char * const argv[])
{"file", required_argument, 0, 'f'},
{"prettyprint", no_argument, 0, 'p'},
{"omitoob", no_argument, 0, 'o'},
{"omitbad", no_argument, 0, 'b'}, //DEPRECATED
{"startaddress", required_argument, 0, 's'},
{"length", required_argument, 0, 'l'},
{"noecc", no_argument, 0, 'n'},
{"noskipbad", no_argument, 0, 'N'},
{"quiet", no_argument, 0, 'q'},
{0, 0, 0, 0},
};
Expand Down Expand Up @@ -187,18 +169,6 @@ static void process_options(int argc, char * const argv[])
break;
}
break;
case 'b':
/* Check if bb_method was already set explicitly */
if (bb_default) {
bb_default = false;
bb_method = omitbad;
warnmsg("--omitbad is being deprecated in favor of --bb=skipbad.\n"
" --omitbad will not be available in future releases.\n"
" Please update your usage accordingly.");
} else {
error++;
}
break;
case 's':
start_addr = simple_strtoll(optarg, &error);
break;
Expand Down Expand Up @@ -233,18 +203,6 @@ static void process_options(int argc, char * const argv[])
case 'n':
noecc = true;
break;
case 'N':
/* Check if bb_method was already set explicitly */
if (bb_default) {
bb_default = false;
bb_method = dumpbad;
warnmsg("--noskipbad is being deprecated in favor of --bb=dumpbad.\n"
" --noskipbad will not be available in future releases.\n"
" Please update your usage accordingly.");
} else {
error++;
}
break;
case '?':
error++;
break;
Expand Down Expand Up @@ -499,8 +457,6 @@ int main(int argc, char * const argv[])
end_addr = mtd.size;
continue;
}
if (bb_method == omitbad)
continue;
memset(readbuf, 0xff, bs);
} else {
/* Read page data and exit on failure */
Expand Down

0 comments on commit d8b8f78

Please sign in to comment.