summaryrefslogtreecommitdiffstats
path: root/udelay.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-02 15:41:42 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-02 15:41:42 +0000
commitf80419c75a344b303275e380add3b8cb750bab9d (patch)
tree124a732dd0d8c171b28649986c716af0477ca746 /udelay.c
parentb66ed84d193b8c0eddf5d946c6d2d94a8e8360ee (diff)
downloadast2050-flashrom-f80419c75a344b303275e380add3b8cb750bab9d.zip
ast2050-flashrom-f80419c75a344b303275e380add3b8cb750bab9d.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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/udelay.c b/udelay.c
index e3cf3e3..ee858b8 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);
}
OpenPOWER on IntegriCloud