Skip to contentSkip to conversation

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

PATCH Applied Yevgeny Kliteynik 3 participants 3 messages Sep 7, 2010 – Sep 9, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

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

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.

---
 opensm/opensm/osm_mesh.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
opensm/opensm/osm_mesh.c +2 -1
index 9d1082a..d156b7a 100644
@@ -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;
 	}
 
Signature · 6 lines
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4C86538E.3080206-VPRAkNaXOzVS1MOuV/[email protected]

#2 lore raw
Quoted 6 lines · Yevgeny Kliteynik

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.

Applied. Thanks.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Thanks Sasha,

I'm not sure where that came from. This was a little optimization that improved the results in some cases. But wouldn't break the rest of the code. Seems to have gotten broken somewhere along the way.

Bob Pearson

Quoted 9 lines · Sasha Khapyorsky
Quoted 7 lines · Yevgeny Kliteynik

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.

Quoted 9 lines

Applied. Thanks.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html