diff options
author | Michal Simek <monstr@monstr.eu> | 2007-10-14 14:31:47 +0200 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2007-10-14 14:31:47 +0200 |
commit | 95df6f4ebaaa3972e312be1acf7650a18b84bf3d (patch) | |
tree | ee69b8872cf8c295a48244280c82d98e191111ab /drivers/nand | |
parent | b49c90df6e7cfcfb8b862b8bbf8448dff5eed9a5 (diff) | |
parent | b90c045f035c3cc9b5d2edaed6048dfb74e40763 (diff) | |
download | u-boot-imx-95df6f4ebaaa3972e312be1acf7650a18b84bf3d.zip u-boot-imx-95df6f4ebaaa3972e312be1acf7650a18b84bf3d.tar.gz u-boot-imx-95df6f4ebaaa3972e312be1acf7650a18b84bf3d.tar.bz2 |
Merge ../master/
Diffstat (limited to 'drivers/nand')
-rw-r--r-- | drivers/nand/nand_util.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/nand/nand_util.c b/drivers/nand/nand_util.c index cf05043..4fd4e16 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 |