kernel: sched: fix legacy timeout calculation in z_tick_sleep

Ticks should be assigned directly to timeout value in case of
CONFIG_LEGACY_TIMEOUT_API=y, just as they were before referenced patch.

Fixes: 7a815d5d99 ("kernel: sched: Use k_ticks_t in z_tick_sleep")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
Marcin Niestroj 2020-12-17 19:34:24 +01:00 committed by Anas Nashif
commit 11cb1cf336

View file

@ -1282,7 +1282,7 @@ static int32_t z_tick_sleep(k_ticks_t ticks)
timeout = Z_TIMEOUT_TICKS(ticks);
#else
ticks += _TICK_ALIGN;
timeout = Z_TIMEOUT_TICKS(ticks);
timeout = ticks;
#endif
expected_wakeup_ticks = ticks + z_tick_get_32();