Discussion:
[Linuxptp-devel] [PATCH] Fix port numbering in clock log messages.
Miroslav Lichvar
2013-08-21 10:57:05 UTC
Permalink
Add 1 to port numbers printed in the log messages to make them
consistent with messages from port.c. The port number 0 is the UDS port,
which is last in the clock->port array.

Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
clock.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clock.c b/clock.c
index 8dd6662..4cde567 100644
--- a/clock.c
+++ b/clock.c
@@ -132,7 +132,7 @@ static int clock_fault_timeout(struct clock *c, int index, int set)
struct fault_interval i;

if (!set) {
- pr_debug("clearing fault on port %d", index);
+ pr_debug("clearing fault on port %d", index + 1);
return set_tmo_lin(c->fault_fd[index], 0);
}

@@ -140,11 +140,11 @@ static int clock_fault_timeout(struct clock *c, int index, int set)

if (i.type == FTMO_LINEAR_SECONDS) {
pr_debug("waiting %d seconds to clear fault on port %d",
- i.val, index);
+ i.val, index + 1);
return set_tmo_lin(c->fault_fd[index], i.val);
} else if (i.type == FTMO_LOG2_SECONDS) {
pr_debug("waiting 2^{%d} seconds to clear fault on port %d",
- i.val, index);
+ i.val, index + 1);
return set_tmo_log(c->fault_fd[index], 1, i.val);
}

@@ -772,7 +772,7 @@ static void clock_forward_mgmt_msg(struct clock *c, struct port *p, struct ptp_m
msg_pre_send(msg);
}
if (port_forward(fwd, msg, pdulen))
- pr_err("port %d: management forward failed", i);
+ pr_err("port %d: management forward failed", i + 1);
}
}
if (msg_ready) {
--
1.8.3.1
Richard Cochran
2013-08-23 09:39:58 UTC
Permalink
Post by Miroslav Lichvar
Add 1 to port numbers printed in the log messages to make them
consistent with messages from port.c. The port number 0 is the UDS port,
which is last in the clock->port array.
Applied.

Thanks,
Richard

Loading...