summaryrefslogtreecommitdiff
path: root/util/flash_and_burn
diff options
context:
space:
mode:
authorLi-Ta Lo <ollie@lanl.gov>2004-03-18 20:27:33 +0000
committerLi-Ta Lo <ollie@lanl.gov>2004-03-18 20:27:33 +0000
commitdf273a58a3b6462242af05ec917b8096952ac9d4 (patch)
tree502ffb5d4976c81a211fef004f03c470d99ed5ba /util/flash_and_burn
parent26b237ee18cf3f846313d85dcb80fb42041c3529 (diff)
downloadcoreboot-df273a58a3b6462242af05ec917b8096952ac9d4.tar.xz
fixed stupid i++ evalution order bug
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1435 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flash_and_burn')
-rw-r--r--util/flash_and_burn/flash_rom.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/util/flash_and_burn/flash_rom.c b/util/flash_and_burn/flash_rom.c
index 13bb182a50..d57957d44e 100644
--- a/util/flash_and_burn/flash_rom.c
+++ b/util/flash_and_burn/flash_rom.c
@@ -141,7 +141,7 @@ int verify_flash (struct flashchip * flash, char * buf, int verbose)
volatile char * bios = flash->virt_addr;
printf("Verifying address: ");
- while (i++ < total_size) {
+ while (i < total_size) {
if (verbose)
printf("0x%08x", i);
if (*(bios+i) != *(buf+i)) {
@@ -150,6 +150,7 @@ int verify_flash (struct flashchip * flash, char * buf, int verbose)
}
if (verbose)
printf("\b\b\b\b\b\b\b\b\b\b");
+ i++
}
if (verbose)
printf("\n");
@@ -178,12 +179,12 @@ int main (int argc, char * argv[])
FILE * image;
struct flashchip * flash;
int opt;
- int read_it = 0, write_it = 0, verify_it = 0;
+ int read_it = 0, write_it = 0, verify_it = 0, verbose = 0;
char *filename = NULL;
setbuf(stdout, NULL);
- while ((opt = getopt(argc, argv, "rwvc:")) != EOF) {
+ while ((opt = getopt(argc, argv, "rwvVc:")) != EOF) {
switch (opt) {
case 'r':
read_it = 1;
@@ -197,6 +198,9 @@ int main (int argc, char * argv[])
case 'c':
chip_to_probe = strdup(optarg);
break;
+ case 'V':
+ verbose = 1;
+ break;
default:
usage(argv[0]);
break;
@@ -257,6 +261,6 @@ int main (int argc, char * argv[])
if (write_it || (!read_it && !verify_it))
flash->write (flash, buf);
if (verify_it)
- verify_flash (flash, buf, /* verbose = */ 0);
+ verify_flash (flash, buf, verbose);
return 0;
}