Commit 2126ba16 authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: rename some labels

sometimes I jumped to "no_incoming_msg" in case of error. This renames
the labels to "out", as the catch both error and normal exit paths.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 48426bda
......@@ -14,7 +14,7 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (pp_hooks.listening)
e = pp_hooks.listening(ppi, pkt, plen);
if (e)
goto no_incoming_msg;
goto out;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_LISTENING;
......@@ -25,7 +25,7 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
goto state_updated;
if (plen == 0)
goto no_incoming_msg;
goto out;
switch (ppi->msg_tmp_header.messageType) {
......@@ -42,7 +42,7 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
}
no_incoming_msg:
out:
if (e == 0)
e = st_com_execute_slave(ppi, 0);
......
......@@ -33,7 +33,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->timers[PP_TIMER_PDELAYREQ]);
/* Send an announce immediately, when becomes master */
if (msg_issue_announce(ppi) < 0)
goto failure;
goto out;
}
if (st_com_check_record_update(ppi))
......@@ -42,31 +42,31 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (pp_timer_expired(ppi->timers[PP_TIMER_SYNC])) {
PP_VPRINTF("event SYNC_INTERVAL_TIMEOUT_EXPIRES\n");
if (msg_issue_sync(ppi) < 0)
goto failure;
goto out;
time_snt = &ppi->last_snt_time;
add_TimeInternal(time_snt, time_snt,
&OPTS(ppi)->outbound_latency);
if (msg_issue_followup(ppi, time_snt))
goto failure;
goto out;
}
if (pp_timer_expired(ppi->timers[PP_TIMER_ANN_INTERVAL])) {
PP_VPRINTF("event ANNOUNCE_INTERVAL_TIMEOUT_EXPIRES\n");
if (msg_issue_announce(ppi) < 0)
goto failure;
goto out;
}
if (!OPTS(ppi)->e2e_mode) {
if (pp_timer_expired(ppi->timers[PP_TIMER_PDELAYREQ])) {
PP_VPRINTF("event PDELAYREQ_INTERVAL_TOUT_EXPIRES\n");
if (msg_issue_pdelay_req(ppi) < 0)
goto failure;
goto out;
}
}
if (plen == 0)
goto no_incoming_msg;
goto out;
/*
* An extension can do special treatment of this message type,
......@@ -78,7 +78,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
msgtype = pp_hooks.master_msg(ppi, pkt, plen, msgtype);
if (msgtype < 0) {
e = msgtype;
goto failure;
goto out;
}
switch (msgtype) {
......@@ -198,8 +198,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
}
no_incoming_msg:
failure:
out:
if (e == 0) {
if (DSDEF(ppi)->slaveOnly ||
DSDEF(ppi)->clockQuality.clockClass == 255)
......
......@@ -25,7 +25,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (pp_hooks.new_slave)
e = pp_hooks.new_slave(ppi, pkt, plen);
if (e)
goto no_incoming_msg;
goto out;
ppi->waiting_for_follow = FALSE;
......@@ -50,7 +50,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
goto state_updated;
if (plen == 0)
goto no_incoming_msg;
goto out;
switch (ppi->msg_tmp_header.messageType) {
......@@ -109,7 +109,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
else
pp_update_delay(ppi, &correction_field);
if (e)
goto no_incoming_msg;
goto out;
ppi->log_min_delay_req_interval =
hdr->logMessageInterval;
......@@ -232,7 +232,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
}
no_incoming_msg:
out:
if (e == 0)
e = st_com_execute_slave(ppi, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment