From ffc0b27db4ddb6f23f359261685077caabb444d2 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Mon, 2 Jul 2018 21:14:15 +0800 Subject: [PATCH] HV: lib: make the argument to udelay unsigned The parameter to udelay is the microseconds to wait for, which should be an unsigned integer. Signed-off-by: Junjie Mao Acked-by: Eddie Dong --- hypervisor/include/lib/rtl.h | 2 +- hypervisor/lib/udelay.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hypervisor/include/lib/rtl.h b/hypervisor/include/lib/rtl.h index 05a0d0761..5d4a14ca3 100644 --- a/hypervisor/include/lib/rtl.h +++ b/hypervisor/include/lib/rtl.h @@ -26,7 +26,7 @@ struct udiv_result { }; /* Function prototypes */ -void udelay(int us); +void udelay(uint32_t us); void *memchr(const void *void_s, int c, size_t n); void *memmove(void *s1, const void *s2, size_t n); int strcmp(const char *s1, const char *s2); diff --git a/hypervisor/lib/udelay.c b/hypervisor/lib/udelay.c index 8c0c213c1..efdca430d 100644 --- a/hypervisor/lib/udelay.c +++ b/hypervisor/lib/udelay.c @@ -6,12 +6,12 @@ #include -void udelay(int loop_count) +void udelay(uint32_t us) { uint64_t dest_tsc, delta_tsc; /* Calculate number of ticks to wait */ - delta_tsc = US_TO_TICKS(loop_count); + delta_tsc = US_TO_TICKS(us); dest_tsc = rdtsc() + delta_tsc; /* Loop until time expired */