etnaviv: drm: Use NSEC_PER_SEC
authorGuido Günther <agx@sigxcpu.org>
Thu, 23 Jan 2020 08:17:07 +0000 (09:17 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sun, 10 May 2020 07:32:12 +0000 (07:32 +0000)
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3534>

src/etnaviv/drm/etnaviv_priv.h

index 8ceb6c3c4313b310fe50b3128f0c1bb01715ec4f..93bd2d90985e1746eb5f744c4cb400f414b78477 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "util/list.h"
 #include "util/macros.h"
+#include "util/timespec.h"
 #include "util/u_atomic.h"
 #include "util/u_debug.h"
 #include "util/vma.h"
@@ -205,8 +206,8 @@ static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint64_t ns)
 {
        struct timespec t;
        clock_gettime(CLOCK_MONOTONIC, &t);
-       tv->tv_sec = t.tv_sec + ns / 1000000000;
-       tv->tv_nsec = t.tv_nsec + ns % 1000000000;
+       tv->tv_sec = t.tv_sec + ns / NSEC_PER_SEC;
+       tv->tv_nsec = t.tv_nsec + ns % NSEC_PER_SEC;
 }
 
 #if HAVE_VALGRIND