diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-05-02 15:41:42 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-05-02 15:41:42 +0000 |
commit | 659b447c4a60f26e0cd0f100c64041819e3fbc22 (patch) | |
tree | 124a732dd0d8c171b28649986c716af0477ca746 /udelay.c | |
parent | 91e19afc759b6194ece002a9a84cf6836ed2d535 (diff) | |
download | flashrom-659b447c4a60f26e0cd0f100c64041819e3fbc22.zip flashrom-659b447c4a60f26e0cd0f100c64041819e3fbc22.tar.gz |
Make delay values unsigned
There is no reason for negative delays in our use cases:
- We don't need it (to work around any quirks).
- sleep() (POSIX) uses an unsigned argument.
- usleep() (POSIX) uses an unsigned argument.
- Sleep() (Windows) uses an unsigned argument.
Change all callees as well (without any complications).
Corresponding to flashrom svn r1782.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'udelay.c')
-rw-r--r-- | udelay.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -30,7 +30,7 @@ /* loops per microsecond */ static unsigned long micro = 1; -__attribute__ ((noinline)) void myusec_delay(int usecs) +__attribute__ ((noinline)) void myusec_delay(unsigned int usecs) { unsigned long i; for (i = 0; i < usecs * micro; i++) { @@ -63,7 +63,7 @@ static unsigned long measure_os_delay_resolution(void) return timeusec; } -static unsigned long measure_delay(int usecs) +static unsigned long measure_delay(unsigned int usecs) { unsigned long timeusec; struct timeval start, end; @@ -170,7 +170,7 @@ recalibrate: } /* Not very precise sleep. */ -void internal_sleep(int usecs) +void internal_sleep(unsigned int usecs) { #ifdef _WIN32 Sleep((usecs + 999) / 1000); @@ -181,7 +181,7 @@ void internal_sleep(int usecs) } /* Precise delay. */ -void internal_delay(int usecs) +void internal_delay(unsigned int usecs) { /* If the delay is >1 s, use internal_sleep because timing does not need to be so precise. */ if (usecs > 1000000) { @@ -199,7 +199,7 @@ void myusec_calibrate_delay(void) get_cpu_speed(); } -void internal_delay(int usecs) +void internal_delay(unsigned int usecs) { udelay(usecs); } |