gsm_timer: fix comparison of constant LONG_MAX with an integer

It does not make sense since INT_MAX is always less than LONG_MAX.
Found by Clang [-Wtautological-constant-out-of-range-compare].

Change-Id: I9934e05aa050bf93b3c795376f5dca3a848a7e11
This commit is contained in:
Vadim Yanitskiy 2020-01-25 04:39:27 +07:00
parent e525bf94ba
commit 4590b91728
1 changed files with 7 additions and 10 deletions

View File

@ -144,17 +144,14 @@ int *osmo_gsm_timers_nearest(void)
static void update_nearest(int *cand, int *current)
{
if (*cand != LONG_MAX) {
if (*cand > *current)
nearest = *cand - *current;
else {
/* loop again inmediately */
nearest = 0;
}
nearest_p = &nearest;
} else {
nearest_p = NULL;
if (*cand > *current)
nearest = *cand - *current;
else {
/* loop again inmediately */
nearest = 0;
}
nearest_p = &nearest;
}
/*