summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2017-08-31 17:58:56 +0100
committerRussell King <rmk@arm.linux.org.uk>2017-08-31 17:58:56 +0100
commit1c4b212d1f5dcf41c963c636498abbff014159ae (patch)
treebd10e72de1141b52679a24294ee6633f0d596581
parenta4306d971717a2d3ea855d08c5667e02403b84fe (diff)
etnaviv: fix timeout calculation
The timeout calculation was multiplying the milliseconds by 10msec in nanoseconds rather than 1msec in nanoseconds. Fix this, and make these more clear by using groups of 1000. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--etnaviv/etnadrm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/etnaviv/etnadrm.c b/etnaviv/etnadrm.c
index 1f08ad4..4789993 100644
--- a/etnaviv/etnadrm.c
+++ b/etnaviv/etnadrm.c
@@ -273,9 +273,9 @@ static void etnadrm_convert_timeout(struct drm_etnaviv_timespec *ts,
clock_gettime(CLOCK_MONOTONIC, &now);
ts->tv_sec = now.tv_sec + timeout / 1000;
- ts->tv_nsec = now.tv_nsec + (timeout % 1000) * 10000000;
- if (ts->tv_nsec > 1000000000) {
- ts->tv_nsec -= 1000000000;
+ ts->tv_nsec = now.tv_nsec + (timeout % 1000) * 1000 * 1000;
+ if (ts->tv_nsec > 1000 * 1000 * 1000) {
+ ts->tv_nsec -= 1000 * 1000 * 1000;
ts->tv_sec += 1;
}
}