diff options
author | Li-Ta Lo <ollie@lanl.gov> | 2004-03-20 16:46:10 +0000 |
---|---|---|
committer | Li-Ta Lo <ollie@lanl.gov> | 2004-03-20 16:46:10 +0000 |
commit | fbf43ac5a6d90468b4f32c0ea0fc29bd41fabf87 (patch) | |
tree | 3cdf0a8d629f9e92cb432a41626255f3ae3dd806 /util/flash_and_burn/udelay.c | |
parent | 6a1a1102ea2cd8aed7014c90241f8db7b71847f1 (diff) | |
download | coreboot-fbf43ac5a6d90468b4f32c0ea0fc29bd41fabf87.tar.xz |
consolidate more jedec standard code
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1457 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flash_and_burn/udelay.c')
-rw-r--r-- | util/flash_and_burn/udelay.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/util/flash_and_burn/udelay.c b/util/flash_and_burn/udelay.c index ad2fb4e3c5..30b8dde261 100644 --- a/util/flash_and_burn/udelay.c +++ b/util/flash_and_burn/udelay.c @@ -7,8 +7,7 @@ unsigned long micro = 1; void myusec_delay(int time) { volatile unsigned long i; - for (i = 0; i < time * micro; i++) - ; + for (i = 0; i < time * micro; i++); } void myusec_calibrate_delay() @@ -23,10 +22,10 @@ void myusec_calibrate_delay() gettimeofday(&start, 0); myusec_delay(count); gettimeofday(&end, 0); - timeusec = 1000000 * (end.tv_sec - start.tv_sec ) + - (end.tv_usec - start.tv_usec); + timeusec = 1000000 * (end.tv_sec - start.tv_sec) + + (end.tv_usec - start.tv_usec); count *= 2; - if (timeusec < 1000000/4) + if (timeusec < 1000000 / 4) continue; ok = 1; } @@ -34,5 +33,5 @@ void myusec_calibrate_delay() // compute one microsecond. That will be count / time micro = count / timeusec; - fprintf(stderr, "%ldM loops per second\n", (unsigned long)micro); + fprintf(stderr, "%ldM loops per second\n", (unsigned long) micro); } |