Commit d0452c0d authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: reverse if to remove indentation

While getting mad with servo.c (which makes little sense to me), and
continuously following the long unseless indented stanza of
pp_update_delay() I finally decided to kill it.  This kills another
similar situation, but each of these changes makes no effect on the
program flow, only simplifies code as written.

You can diff with "-w" to verify I don't change code.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 5b875edc
......@@ -142,7 +142,9 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
if (len < PP_SYNC_LENGTH)
return -1;
if (ppi->is_from_cur_par) {
if (!ppi->is_from_cur_par)
return 0;
ppi->t2 = ppi->last_rcv_time;
if ((hdr->flagField[0] & PP_TWO_STEP_FLAG) != 0) {
......@@ -152,7 +154,8 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
int64_to_TimeInternal(
hdr->correctionfield,
&ppi->last_sync_corr_field);
} else {
return 0;
}
msg_unpack_sync(buf, &sync);
int64_to_TimeInternal(
ppi->received_ptp_header.correctionfield,
......@@ -166,8 +169,6 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
&sync.originTimestamp);
pp_update_offset(ppi, &correction_field);
pp_update_clock(ppi);
}
}
return 0;
}
......
......@@ -26,6 +26,7 @@ void pp_update_delay(struct pp_instance *ppi, TimeInternal *correction_field)
{
TimeInternal s_to_m_dly;
struct pp_owd_fltr *owd_fltr = &SRV(ppi)->owd_fltr;
int s;
/* calc 'slave to master' delay */
sub_TimeInternal(&s_to_m_dly, &ppi->t4, &ppi->t3);
......@@ -46,8 +47,8 @@ void pp_update_delay(struct pp_instance *ppi, TimeInternal *correction_field)
return;
}
if (OPTS(ppi)->ofst_first_updated) {
Integer16 s;
if (!OPTS(ppi)->ofst_first_updated)
return;
/* calc 'slave to_master' delay (master to slave delay is
* already computed in pp_update_offset)
......@@ -97,7 +98,6 @@ void pp_update_delay(struct pp_instance *ppi, TimeInternal *correction_field)
pp_diag(ppi, servo, 1, "delay filter %d, %d\n",
owd_fltr->y, owd_fltr->s_exp);
}
}
/*
......
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