[PATCH] opensm/osm_mesh.c: fixing a bug in compare_switches()

Yevgeny Kliteynik
2010-09-07T15:00:30Z

I'm pretty sure that ";" at the end of "if" statement
is not supposed to be there (not sure how it worked till
now though).
Also, making this condition a bit more readable.

Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
---
opensm/opensm/osm_mesh.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_mesh.c b/opensm/opensm/osm_mesh.c
index 9d1082a..d156b7a 100644
--- a/opensm/opensm/osm_mesh.c
+++ b/opensm/opensm/osm_mesh.c
@@ -1385,7 +1385,8 @@ static int compare_switches(const void *p1, const void *p2)

for (i = 0; i < ctx->mesh->dimension; i++) {
j = ctx->mesh->dim_order[i];
- if ((ret = s1->node->coord[j] - s2->node->coord[j]));
+ ret = s1->node->coord[j] - s2->node->coord[j];
+ if (ret)
return ret;
}

--
1.6.2.4