Lines Matching +full:int +full:- +full:b

4  * SPDX-License-Identifier: Apache-2.0
18 #define B_BETTER (-1)
19 #define B_BETTER_TOPOLOGY (-2)
21 static int btca_port_id_cmp(const struct ptp_port_id *p1, const struct ptp_port_id *p2) in btca_port_id_cmp()
23 int diff = memcmp(&p1->clk_id, &p2->clk_id, sizeof(p1->clk_id)); in btca_port_id_cmp()
26 diff = p1->port_number - p2->port_number; in btca_port_id_cmp()
32 static int btca_ds_cmp2(const struct ptp_dataset *a, const struct ptp_dataset *b) in btca_ds_cmp2() argument
34 int diff; in btca_ds_cmp2()
36 if (b->steps_rm + 1 < a->steps_rm) { in btca_ds_cmp2()
39 if (a->steps_rm + 1 < b->steps_rm) { in btca_ds_cmp2()
42 if (a->steps_rm > b->steps_rm) { in btca_ds_cmp2()
43 diff = btca_port_id_cmp(&a->receiver, &a->sender); in btca_ds_cmp2()
50 /* error-1 */ in btca_ds_cmp2()
53 if (a->steps_rm < b->steps_rm) { in btca_ds_cmp2()
54 diff = btca_port_id_cmp(&b->receiver, &b->sender); in btca_ds_cmp2()
61 /* error-1 */ in btca_ds_cmp2()
65 diff = btca_port_id_cmp(&a->sender, &b->sender); in btca_ds_cmp2()
73 if (a->receiver.port_number > b->receiver.port_number) { in btca_ds_cmp2()
76 if (a->receiver.port_number > b->receiver.port_number) { in btca_ds_cmp2()
79 /* error-2 */ in btca_ds_cmp2()
83 int ptp_btca_ds_cmp(const struct ptp_dataset *a, const struct ptp_dataset *b) in ptp_btca_ds_cmp() argument
85 if (a == b) { in ptp_btca_ds_cmp()
88 if (a && !b) { in ptp_btca_ds_cmp()
91 if (!a && b) { in ptp_btca_ds_cmp()
95 int id_diff = memcmp(&a->clk_id, &b->clk_id, sizeof(a->clk_id)); in ptp_btca_ds_cmp()
98 return btca_ds_cmp2(a, b); in ptp_btca_ds_cmp()
100 if (a->priority1 > b->priority1) { in ptp_btca_ds_cmp()
103 if (a->clk_quality.cls > b->clk_quality.cls) { in ptp_btca_ds_cmp()
106 if (a->clk_quality.accuracy > b->clk_quality.accuracy) { in ptp_btca_ds_cmp()
109 if (a->clk_quality.offset_scaled_log_variance > b->clk_quality.offset_scaled_log_variance) { in ptp_btca_ds_cmp()
112 if (a->priority2 > b->priority2) { in ptp_btca_ds_cmp()
132 if (clk_default->clk_quality.cls <= 127) { in ptp_btca_state_decision()
146 if (clk_best_foreign->port == port) { in ptp_btca_state_decision()