From f80419c75a344b303275e380add3b8cb750bab9d Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Fri, 2 May 2014 15:41:42 +0000 Subject: 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 Acked-by: Stefan Tauner --- udelay.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'udelay.c') diff --git a/udelay.c b/udelay.c index e3cf3e30..ee858b8e 100644 --- a/udelay.c +++ b/udelay.c @@ -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); } -- cgit v1.2.3