Thanks Richard for the feedback. Some replies inline. I agree with all the other feedback you provided for the other 3 patches. I will make the corresponding change and send the patches by tomorrow.
> >> +{ >> + if (s->offset_threshold && offset) { > > Why test offset != 0 here? It’s not needed. Will remove it. > >> + if (abs(offset) < s->offset_threshold && s->curr_offset_values) > > Since you are Using abs(), don't you need a special case test for > offset > INT_MAX ? > Yeah, sorry I missed it. Will check that. >> + s->curr_offset_values--; >> + return s->curr_offset_values ? 0 : 1; >> + } >> + return 0; >> +} >> + >> double servo_sample(struct servo *servo, >> int64_t offset, >> uint64_t local_ts, >> @@ -100,6 +113,12 @@ double servo_sample(struct servo *servo, >> >> if (*state != SERVO_UNLOCKED) >> servo->first_update = 0; >> + else >> + servo->curr_offset_values = servo->num_offset_values; >> + >> + if (*state == SERVO_LOCKED && check_offset_threshold(servo, offset)) { >> + *state = SERVO_LOCKED_STABLE; >> + } > > This is getting hard to follow. Time for switch/case(*state) with all the > cases listed explicitly. Yeah will change this to switch/case. Thanks, Vedang > > Thanks, > Richard _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel