Commit 970fdbaf authored by Alessandro Rubini's avatar Alessandro Rubini

wr-servo: kill a needless function

timeint_to_wr was actually copying data to a local uninitialized
variable of the same type as the input one.  The uninitialized
structure generates warnings about unitialized fields (at least on
newer compilers than the one we use on wr-switch).

Instead of clearing the local variable, just use structure assignment
and get rid of the function.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent a54e9679
......@@ -200,15 +200,6 @@ int wr_servo_init(struct pp_instance *ppi)
return 0;
}
TimeInternal timeint_to_wr(TimeInternal t)
{
TimeInternal ts;
ts.seconds = t.seconds;
ts.nanoseconds = t.nanoseconds;
ts.phase = t.phase;
return ts;
}
static int ph_adjust = 0;
int wr_servo_man_adjust_phase(int phase)
......@@ -223,10 +214,9 @@ int wr_servo_got_sync(struct pp_instance *ppi, TimeInternal *t1,
struct wr_servo_state_t *s =
&((struct wr_data_t *)ppi->ext_data)->servo_state;
s->t1 = timeint_to_wr(*t1);
s->t1 = *t1;
s->t1.correct = 1;
s->t2 = timeint_to_wr(*t2);
s->t2.correct = t2->correct;
s->t2 = *t2;
got_sync = 1;
......@@ -240,7 +230,7 @@ int wr_servo_got_delay(struct pp_instance *ppi, Integer32 cf)
s->t3 = ppi->t3;
/* s->t3.phase = 0; */
s->t4 = timeint_to_wr(ppi->t4);
s->t4 = ppi->t4;
s->t4.correct = 1; /* clock->delay_req_receive_time.correct; */
s->t4.phase = (int64_t) cf * 1000LL / 65536LL;
......
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