The current implementation of test_phc cmp has a fallback flow for comparing
the PHC clock to the CLOCK_REAMTIME. This fallback flow calculates the
inverse offset compared to the offsets calculated by the PTP_SYS_OFFSET
ioctls.

Fix this by replacing its implementation with the one from phc2sys. Move
read_phc function into clockadj.c to re-use it.

Changes since v1
* Make clockadj_compare return -1 on failure and 0 on success
* Fix callsites in phc2sys to handle this change

Jacob Keller (2):
  phc2sys: move read_phc into clock_adj.c
  phc_ctl: replace calculate_offset with clockadj_compare

 clockadj.c | 31 +++++++++++++++++++++++++++++++
 clockadj.h | 16 ++++++++++++++++
 phc2sys.c  | 46 +++++++++-------------------------------------
 phc_ctl.c  | 54 ++++++++++++++++--------------------------------------
 4 files changed, 72 insertions(+), 75 deletions(-)


base-commit: 63592effe3f3ff616a19bfff3757fd3dbd95baf5
-- 
2.31.1.331.gb0c09ab8796f



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to