From: Benjamin Berg <benjamin.berg@xxxxxxxxx> Just simplify the code a little bit by using the helper instead of doing the math inline. Signed-off-by: Benjamin Berg <benjamin.berg@xxxxxxxxx> --- wpa_supplicant/wnm_sta.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index 015a1948e..7857e4ed8 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -1598,11 +1598,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, wpa_printf(MSG_DEBUG, "WNM: Candidate list valid for %u ms", valid_ms); os_get_reltime(&wpa_s->wnm_cand_valid_until); - wpa_s->wnm_cand_valid_until.sec += valid_ms / 1000; - wpa_s->wnm_cand_valid_until.usec += (valid_ms % 1000) * 1000; - wpa_s->wnm_cand_valid_until.sec += - wpa_s->wnm_cand_valid_until.usec / 1000000; - wpa_s->wnm_cand_valid_until.usec %= 1000000; + os_reltime_add_ms(&wpa_s->wnm_cand_valid_until, valid_ms); /* * Try fetching the latest scan results from the kernel. -- 2.44.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap