All of the callers of transport_peer() use hard coded magic numbers.
This patch fixes them to use the corresponding enumerated values instead.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 port.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/port.c b/port.c
index a777701..6eeecfa 100644
--- a/port.c
+++ b/port.c
@@ -567,7 +567,7 @@ static int path_trace_ignore(struct port *p, struct 
ptp_message *m)
 }
 
 static int peer_prepare_and_send(struct port *p, struct ptp_message *msg,
-                                int event)
+                                enum transport_event event)
 {
        int cnt;
        if (msg_pre_send(msg)) {
@@ -1234,7 +1234,7 @@ static int port_pdelay_request(struct port *p)
        msg->header.logMessageInterval = port_is_ieee8021as(p) ?
                p->logMinPdelayReqInterval : 0x7f;
 
-       err = peer_prepare_and_send(p, msg, 1);
+       err = peer_prepare_and_send(p, msg, TRANS_EVENT);
        if (err) {
                pr_err("port %hu: send peer delay request failed", portnum(p));
                goto out;
@@ -1877,7 +1877,8 @@ void process_follow_up(struct port *p, struct ptp_message 
*m)
 int process_pdelay_req(struct port *p, struct ptp_message *m)
 {
        struct ptp_message *rsp, *fup;
-       int err, event;
+       enum transport_event event;
+       int err;
 
        switch (p->timestamping) {
        case TS_SOFTWARE:
@@ -1986,7 +1987,7 @@ int process_pdelay_req(struct port *p, struct ptp_message 
*m)
        fup->pdelay_resp_fup.responseOriginTimestamp =
                tmv_to_Timestamp(rsp->hwts.ts);
 
-       err = peer_prepare_and_send(p, fup, 0);
+       err = peer_prepare_and_send(p, fup, TRANS_GENERAL);
        if (err) {
                pr_err("port %hu: send pdelay_resp_fup failed", portnum(p));
        }
-- 
2.11.0


------------------------------------------------------------------------------
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