On Tue, Nov 10, 2020 at 02:21:41PM -0800, Richard Cochran wrote:
> Reduce the expression !(x < y) to (x >= y).
>
> While we're at it, clean the coding style as well.
>
> Signed-off-by: Richard Cochran <[email protected]>
> ---
> pmc_agent.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/pmc_agent.c b/pmc_agent.c
> index cfe1b4b..528d4ee 100644
> --- a/pmc_agent.c
> +++ b/pmc_agent.c
> @@ -351,12 +351,13 @@ int update_pmc_node(struct pmc_agent *node)
> }
> ts = tp.tv_sec * NS_PER_SEC + tp.tv_nsec;
>
> - if (!(ts - node->pmc_last_update < PMC_UPDATE_INTERVAL)) {
> + if (ts - node->pmc_last_update >= PMC_UPDATE_INTERVAL) {
How about:
pmc_agent: update_pmc_node: perform time comparison using positive logic
I wonder how many more "simplify update_pmc_node even moar" patches
there are to come.
> if (node->subscription_active) {
> renew_subscription(node, 0);
> }
> - if (run_pmc_get_utc_offset(node, 0) > 0)
> + if (run_pmc_get_utc_offset(node, 0) > 0) {
> node->pmc_last_update = ts;
> + }
> }
>
> return 0;
> --
> 2.20.1
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel