On Tue, Nov 10, 2020 at 02:21:40PM -0800, Richard Cochran wrote:
> The monotonic clock can never go backwards.  If you take T1 and later T2
> from that clock, then (T2 > T1) is always true.
> 
> This patch removes the useless test.
> 
> [ This test evolved over the years. Originally the time stamp in question
>   came from a PHC. ]
> 
> Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
> ---
>  pmc_agent.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/pmc_agent.c b/pmc_agent.c
> index 47562bc..cfe1b4b 100644
> --- a/pmc_agent.c
> +++ b/pmc_agent.c
> @@ -351,8 +351,7 @@ int update_pmc_node(struct pmc_agent *node)
>       }
>       ts = tp.tv_sec * NS_PER_SEC + tp.tv_nsec;
>  
> -     if (!(ts > node->pmc_last_update &&
> -           ts - node->pmc_last_update < PMC_UPDATE_INTERVAL)) {
> +     if (!(ts - node->pmc_last_update < PMC_UPDATE_INTERVAL)) {

How about this for a commit title:
pmc_agent: update_pmc_node: remove comparison between last update and now

I think it scales a bit better to describe what the patch is doing,
rather than how much more simpler the code becomes.

>               if (node->subscription_active) {
>                       renew_subscription(node, 0);
>               }
> -- 
> 2.20.1


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

Reply via email to