Commit 02b6375f authored by Alessandro Rubini's avatar Alessandro Rubini

bmc: use helper variables

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 9f177f4e
...@@ -95,6 +95,7 @@ static int bmc_dataset_cmp(struct pp_instance *ppi, ...@@ -95,6 +95,7 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
MsgHeader *hdr_a, MsgAnnounce *ann_a, MsgHeader *hdr_a, MsgAnnounce *ann_a,
MsgHeader *hdr_b, MsgAnnounce *ann_b) MsgHeader *hdr_b, MsgAnnounce *ann_b)
{ {
struct ClockQuality *qa, *qb;
Octet *ppci; Octet *ppci;
PP_VPRINTF("BMC: in bmc_dataset_cmp\n"); PP_VPRINTF("BMC: in bmc_dataset_cmp\n");
...@@ -150,18 +151,20 @@ static int bmc_dataset_cmp(struct pp_instance *ppi, ...@@ -150,18 +151,20 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
} }
/* GrandMaster are not identical */ /* GrandMaster are not identical */
qa = &ann_a->grandmasterClockQuality;
qb = &ann_b->grandmasterClockQuality;
if (ann_a->grandmasterPriority1 != ann_b->grandmasterPriority1) if (ann_a->grandmasterPriority1 != ann_b->grandmasterPriority1)
return ann_a->grandmasterPriority1 - ann_b->grandmasterPriority1; return ann_a->grandmasterPriority1 - ann_b->grandmasterPriority1;
if (ann_a->grandmasterClockQuality.clockClass != ann_b->grandmasterClockQuality.clockClass) if (qa->clockClass != qb->clockClass)
return ann_a->grandmasterClockQuality.clockClass - ann_b->grandmasterClockQuality.clockClass; return qa->clockClass - qb->clockClass;
if (ann_a->grandmasterClockQuality.clockAccuracy != ann_b->grandmasterClockQuality.clockAccuracy) if (qa->clockAccuracy != qb->clockAccuracy)
return ann_a->grandmasterClockQuality.clockAccuracy - ann_b->grandmasterClockQuality.clockAccuracy; return qa->clockAccuracy - qb->clockAccuracy;
if (ann_a->grandmasterClockQuality.offsetScaledLogVariance != ann_b->grandmasterClockQuality.offsetScaledLogVariance) if (qa->offsetScaledLogVariance != qb->offsetScaledLogVariance)
return ann_a->grandmasterClockQuality.clockClass - ann_b->grandmasterClockQuality.clockClass; return qa->clockClass - qb->clockClass;
if (ann_a->grandmasterPriority2 != ann_b->grandmasterPriority2) if (ann_a->grandmasterPriority2 != ann_b->grandmasterPriority2)
return ann_a->grandmasterPriority2 - ann_b->grandmasterPriority2; return ann_a->grandmasterPriority2 - ann_b->grandmasterPriority2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment