On Sun, Nov 08, 2020 at 08:34:33AM -0800, Richard Cochran wrote: > The "free_running" configuration option is meant to allow running the > software without actually adjusting the clock at all. However, both the > ptp4l and the ts2phc programs set the clock frequency unconditionally > on startup. This patch fixes issue by testing whether the clock is free > running before setting the frequency. > > Signed-off-by: Richard Cochran <richardcoch...@gmail.com> > --- > clock.c | 5 +++-- > ts2phc_slave.c | 5 +++-- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/clock.c b/clock.c > index a66d189..0156bc3 100644 > --- a/clock.c > +++ b/clock.c > @@ -1114,8 +1114,9 @@ struct clock *clock_create(enum clock_type type, struct > config *config, > /* Due to a bug in older kernels, the reading may silently fail > and return 0. Set the frequency back to make sure fadj is > the actual frequency of the clock. */ > - clockadj_set_freq(c->clkid, fadj); > - > + if (!c->free_running) { > + clockadj_set_freq(c->clkid, fadj); > + }
What is the convention for single statement blocks in linuxptp? Use braces or not? I've seen both used. _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel