The function ts_to_Timestamp() is now just a wrapper around
tmv_to_Timestamp().  Simplify code by using tmv_to_Timestamp()
directly.

Signed-off-by: Michael Brown <mbr...@fensystems.co.uk>
---
 port.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/port.c b/port.c
index 17ae5cd..1b8149f 100644
--- a/port.c
+++ b/port.c
@@ -385,11 +385,6 @@ static void ts_add(tmv_t *ts, Integer64 correction)
        *ts = tmv_add(*ts, correction_to_tmv(correction));
 }
 
-static struct Timestamp ts_to_Timestamp(tmv_t src)
-{
-       return tmv_to_Timestamp(src);
-}
-
 /*
  * Returns non-zero if the announce message is different than last.
  */
@@ -1496,7 +1491,7 @@ static int port_tx_sync(struct port *p, struct address 
*dst)
        fup->header.control            = CTL_FOLLOW_UP;
        fup->header.logMessageInterval = p->logSyncInterval;
 
-       fup->follow_up.preciseOriginTimestamp = ts_to_Timestamp(msg->hwts.ts);
+       fup->follow_up.preciseOriginTimestamp = tmv_to_Timestamp(msg->hwts.ts);
 
        if (dst) {
                fup->address = *dst;
@@ -1790,7 +1785,7 @@ static int process_delay_req(struct port *p, struct 
ptp_message *m)
        msg->header.control            = CTL_DELAY_RESP;
        msg->header.logMessageInterval = p->logMinDelayReqInterval;
 
-       msg->delay_resp.receiveTimestamp = ts_to_Timestamp(m->hwts.ts);
+       msg->delay_resp.receiveTimestamp = tmv_to_Timestamp(m->hwts.ts);
 
        msg->delay_resp.requestingPortIdentity = m->header.sourcePortIdentity;
 
@@ -1965,7 +1960,7 @@ static int process_pdelay_req(struct port *p, struct 
ptp_message *m)
         * NB - We do not have any fraction nanoseconds for the correction
         * fields, neither in the response or the follow up.
         */
-       rsp->pdelay_resp.requestReceiptTimestamp = ts_to_Timestamp(m->hwts.ts);
+       rsp->pdelay_resp.requestReceiptTimestamp = tmv_to_Timestamp(m->hwts.ts);
        rsp->pdelay_resp.requestingPortIdentity = m->header.sourcePortIdentity;
 
        fup->hwts.type = p->timestamping;
@@ -1993,7 +1988,7 @@ static int process_pdelay_req(struct port *p, struct 
ptp_message *m)
        }
 
        fup->pdelay_resp_fup.responseOriginTimestamp =
-               ts_to_Timestamp(rsp->hwts.ts);
+               tmv_to_Timestamp(rsp->hwts.ts);
 
        err = peer_prepare_and_send(p, fup, 0);
        if (err)
-- 
2.14.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to