net: dhcpv4: Refactor because of timeout overhaul

Convert minimal parts to support k_timeout_t values.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-04-03 13:47:34 +03:00
commit 76d07ccd00

View file

@ -405,7 +405,7 @@ fail:
static void dhcpv4_update_timeout_work(u32_t timeout)
{
if (!k_delayed_work_remaining_get(&timeout_work) ||
K_SECONDS(timeout) <
(MSEC_PER_SEC * timeout) <
k_delayed_work_remaining_get(&timeout_work)) {
k_delayed_work_cancel(&timeout_work);
k_delayed_work_submit(&timeout_work, K_SECONDS(timeout));
@ -427,7 +427,7 @@ static void dhcpv4_enter_selecting(struct net_if *iface)
static bool dhcpv4_check_timeout(s64_t start, u32_t time, s64_t timeout)
{
start += K_SECONDS(time);
start += MSEC_PER_SEC * time;
if (start < 0) {
start = -start;
}