radv: just use UINT64_MAX when getting absolute timeout for that value

this would otherwise result in (UINT64_MAX - gettime()), which can effectively
be rounded to UINT64_MAX without a noticeable change

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12680>
This commit is contained in:
Mike Blumenkrantz 2021-09-01 11:55:08 -04:00 committed by Marge Bot
parent 45f35900c3
commit 34f0aef19b
1 changed files with 7 additions and 3 deletions

View File

@ -99,11 +99,15 @@ radv_get_current_time(void)
static uint64_t
radv_get_absolute_timeout(uint64_t timeout)
{
uint64_t current_time = radv_get_current_time();
if (timeout == UINT64_MAX) {
return timeout;
} else {
uint64_t current_time = radv_get_current_time();
timeout = MIN2(UINT64_MAX - current_time, timeout);
timeout = MIN2(UINT64_MAX - current_time, timeout);
return current_time + timeout;
return current_time + timeout;
}
}
static int