summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJon Loeliger <jdl@freescale.com>2007-08-13 11:01:52 -0500
committerJon Loeliger <jdl@freescale.com>2007-08-13 11:01:52 -0500
commit8e2dd87eee01bb1b83beab7caf22b851c5cafb2c (patch)
tree47a43e05d90de7d64ed356bab5f15e8d89f5b5cc /drivers
parentcca34967cbd13ff6bd352be29e3f1cc88ab24c05 (diff)
parent9986bc3e40e899bea372a99a2bca4071bdf2e24b (diff)
downloadu-boot-imx-8e2dd87eee01bb1b83beab7caf22b851c5cafb2c.zip
u-boot-imx-8e2dd87eee01bb1b83beab7caf22b851c5cafb2c.tar.gz
u-boot-imx-8e2dd87eee01bb1b83beab7caf22b851c5cafb2c.tar.bz2
Merge commit 'remotes/wd/master'
Conflicts: MAKEALL With any luck, this is the last MAKEALL merge conflict!
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nand/nand_util.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/nand/nand_util.c b/drivers/nand/nand_util.c
index 88c1df6..aee8727 100644
--- a/drivers/nand/nand_util.c
+++ b/drivers/nand/nand_util.c
@@ -37,6 +37,7 @@
#include <command.h>
#include <watchdog.h>
#include <malloc.h>
+#include <div64.h>
#include <nand.h>
#include <jffs2/jffs2.h>
@@ -208,10 +209,10 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
}
if (!opts->quiet) {
- int percent = (int)
- ((unsigned long long)
+ unsigned long long n =(unsigned long long)
(erase.addr+meminfo->erasesize-opts->offset)
- * 100 / erase_length);
+ * 100;
+ int percent = (int)do_div(n, erase_length);
/* output progress message only at whole percent
* steps to reduce the number of messages printed
@@ -475,10 +476,9 @@ int nand_write_opts(nand_info_t *meminfo, const nand_write_options_t *opts)
imglen -= readlen;
if (!opts->quiet) {
- int percent = (int)
- ((unsigned long long)
- (opts->length-imglen) * 100
- / opts->length);
+ unsigned long long n = (unsigned long long)
+ (opts->length-imglen) * 100;
+ int percent = (int)do_div(n, opts->length);
/* output progress message only at whole percent
* steps to reduce the number of messages printed
* on (slow) serial consoles
@@ -651,10 +651,9 @@ int nand_read_opts(nand_info_t *meminfo, const nand_read_options_t *opts)
}
if (!opts->quiet) {
- int percent = (int)
- ((unsigned long long)
- (opts->length-imglen) * 100
- / opts->length);
+ unsigned long long n = (unsigned long long)
+ (opts->length-imglen) * 100;
+ int percent = (int)do_div(n ,opts->length);
/* output progress message only at whole percent
* steps to reduce the number of messages printed
* on (slow) serial consoles