summaryrefslogtreecommitdiff
path: root/drivers/nand/nand_util.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2007-09-24 14:43:43 -0500
committerKim Phillips <kim.phillips@freescale.com>2007-09-24 14:43:43 -0500
commit8ffc774993725a0646aa8d1995d968c95aee9e3c (patch)
treeee69b8872cf8c295a48244280c82d98e191111ab /drivers/nand/nand_util.c
parentd7fee32b7e61fe11c64e371cde79faa4768e8350 (diff)
parent66dcad3a9a53e0766d90e0084123bd8529522fb0 (diff)
Merge branch 'master' of git://www.denx.de/git/u-boot
Diffstat (limited to 'drivers/nand/nand_util.c')
-rw-r--r--drivers/nand/nand_util.c21
1 files changed, 16 insertions, 5 deletions
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