From: Miroslav Lichvar Date: Fri, 20 Jan 2017 11:05:02 +0000 (+0100) Subject: ntp: simplify UTI_Ntp64ToTimespec() callers X-Git-Tag: 3.1-pre1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b98dadae98f6770df5a7dee38c0cd5c742ed77e;p=thirdparty%2Fchrony.git ntp: simplify UTI_Ntp64ToTimespec() callers Since UTI_Ntp64ToTimespec() was modified to handle zero timestamps, some of its callers don't need to do that anymore. --- diff --git a/ntp_core.c b/ntp_core.c index de139116..48ae3d1a 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1943,10 +1943,7 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a !UTI_CompareNtp64(&message->originate_ts, local_ntp_rx); if (interleaved) { - if (!UTI_IsZeroNtp64(local_ntp_tx)) - UTI_Ntp64ToTimespec(local_ntp_tx, &local_tx.ts); - else - interleaved = 0; + UTI_Ntp64ToTimespec(local_ntp_tx, &local_tx.ts); tx_ts = &local_tx; } else { UTI_ZeroNtp64(local_ntp_tx); @@ -2041,9 +2038,6 @@ NCR_ProcessTxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a CLG_GetNtpTimestamps(log_index, &local_ntp_rx, &local_ntp_tx); - if (UTI_IsZeroNtp64(local_ntp_tx)) - return; - UTI_Ntp64ToTimespec(local_ntp_tx, &local_tx.ts); update_tx_timestamp(&local_tx, tx_ts, local_ntp_rx, NULL, message); UTI_TimespecToNtp64(&local_tx.ts, local_ntp_tx, NULL);