Hi,

I think we should put a comment there.
It does looks buzzard to see ' ts->tv_nsec = ntx.time.tv_usec'.
Though this is how 'ADJ_NANO' works 😊

Erez

-----Original Message-----
From: Miroslav Lichvar <mlich...@redhat.com> 
Sent: Monday, 26 September 2022 10:57
To: j.raczynski <j.raczyn...@elpromaelectronics.com>
Cc: linuxptp-devel@lists.sourceforge.net
Subject: Re: [Linuxptp-devel] [PATCH] Fixed time of generic ts2phc master

On Mon, Sep 26, 2022 at 09:53:34AM +0200, j.raczynski wrote:
> Fixed incorrect conversion of units from [us] to [ns] when polling PPS 
> time from generic master in ts2phc program.

> --- a/ts2phc_generic_pps_source.c
> +++ b/ts2phc_generic_pps_source.c
> @@ -42,7 +42,7 @@ static int ts2phc_generic_pps_source_getppstime(struct 
> ts2phc_pps_source *src,
>               return -1;
>       }
>       ts->tv_sec  = ntx.time.tv_sec + ntx.tai;
> -     ts->tv_nsec = ntx.time.tv_usec;
> +     ts->tv_nsec = ntx.time.tv_usec * 1000;

There is ADJ_NANO passed to the adjtimex call few lines above this, so it 
should be in nanoseconds, even though it says tv_usec.

Did you see a bug, or was this just a review?

--
Miroslav Lichvar



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&amp;data=05%7C01%7Cerez.geva.ext%40siemens.com%7C8613f4fd91564ec8914908da9f9d4e7f%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637997795218339465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5yiVNbmFsS555g6rs4q1KmRfQI5yNq3XhoeAjWCl2Lc%3D&amp;reserved=0

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

Reply via email to