summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cmd_nand.c2
-rw-r--r--drivers/nand/nand_util.c21
2 files changed, 17 insertions, 6 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index aeb76e5fb7..1fdd7a67f6 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -456,7 +456,7 @@ U_BOOT_CMD(nand, 5, 1, do_nand,
"info - show available NAND devices\n"
"nand device [dev] - show or set current device\n"
"nand read[.jffs2] - addr off|partition size\n"
- "nand write[.jffs2] - addr off|partiton size - read/write `size' bytes starting\n"
+ "nand write[.jffs2] - addr off|partition size - read/write `size' bytes starting\n"
" at offset `off' to/from memory address `addr'\n"
"nand erase [clean] [off size] - erase `size' bytes from\n"
" offset `off' (entire device if not specified)\n"
diff --git a/drivers/nand/nand_util.c b/drivers/nand/nand_util.c
index cf05043c0a..4fd4e166e6 100644
--- a/drivers/nand/nand_util.c
+++ b/drivers/nand/nand_util.c
@@ -210,9 +210,12 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
if (!opts->quiet) {
unsigned long long n =(unsigned long long)
- (erase.addr+meminfo->erasesize-opts->offset)
- * 100;
- int percent = (int)do_div(n, erase_length);
+ (erase.addr + meminfo->erasesize - opts->offset)
+ * 100;
+ int percent;
+
+ do_div(n, erase_length);
+ percent = (int)n;
/* output progress message only at whole percent
* steps to reduce the number of messages printed
@@ -478,7 +481,11 @@ int nand_write_opts(nand_info_t *meminfo, const nand_write_options_t *opts)
if (!opts->quiet) {
unsigned long long n = (unsigned long long)
(opts->length-imglen) * 100;
- int percent = (int)do_div(n, opts->length);
+ int percent;
+
+ do_div(n, opts->length);
+ percent = (int)n;
+
/* output progress message only at whole percent
* steps to reduce the number of messages printed
* on (slow) serial consoles
@@ -653,7 +660,11 @@ int nand_read_opts(nand_info_t *meminfo, const nand_read_options_t *opts)
if (!opts->quiet) {
unsigned long long n = (unsigned long long)
(opts->length-imglen) * 100;
- int percent = (int)do_div(n ,opts->length);
+ int percent;
+
+ do_div(n, opts->length);
+ percent = (int)n;
+
/* output progress message only at whole percent
* steps to reduce the number of messages printed
* on (slow) serial consoles