The current code overflows (s *
1000000000) for s >= 5 but that is
e.g. used in msm_bo_cpu_prep.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3514>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3514>
static inline void get_abs_timeout(struct drm_msm_timespec *tv, uint64_t ns)
{
struct timespec t;
- uint32_t s = ns / 1000000000;
clock_gettime(CLOCK_MONOTONIC, &t);
- tv->tv_sec = t.tv_sec + s;
- tv->tv_nsec = t.tv_nsec + ns - (s * 1000000000);
+ tv->tv_sec = t.tv_sec + ns / 1000000000;
+ tv->tv_nsec = t.tv_nsec + ns % 1000000000;
}
/*