diff mbox

[1/3] opensm: Use local variables when searching for torus-2QoS master spanning tree root.

Message ID 1266337005-29874-2-git-send-email-jaschut@sandia.gov (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jim Schutt Feb. 16, 2010, 4:16 p.m. UTC
None
diff mbox

Patch

diff --git a/opensm/opensm/osm_ucast_torus.c b/opensm/opensm/osm_ucast_torus.c
index e2eb324..728e56c 100644
--- a/opensm/opensm/osm_ucast_torus.c
+++ b/opensm/opensm/osm_ucast_torus.c
@@ -8751,22 +8751,23 @@  ib_api_status_t torus_mcast_stree(void *context, osm_mgrp_box_t *mgb)
 }
 
 static
-bool good_xy_ring(struct torus *t, int x, int y, int z)
+bool good_xy_ring(struct torus *t, const int x, const int y, const int z)
 {
 	struct t_switch ****sw = t->sw;
 	bool good_ring = true;
+	int x_tst, y_tst;
 
-	for (x = 0; x < t->x_sz && good_ring; x++)
-		good_ring = sw[x][y][z];
+	for (x_tst = 0; x_tst < t->x_sz && good_ring; x_tst++)
+		good_ring = sw[x_tst][y][z];
 
-	for (y = 0; y < t->y_sz && good_ring; y++)
-		good_ring = sw[x][y][z];
+	for (y_tst = 0; y_tst < t->y_sz && good_ring; y_tst++)
+		good_ring = sw[x][y_tst][z];
 
 	return good_ring;
 }
 
 static
-struct t_switch *find_plane_mid(struct torus *t, int z)
+struct t_switch *find_plane_mid(struct torus *t, const int z)
 {
 	int x, dx, xm = t->x_sz / 2;
 	int y, dy, ym = t->y_sz / 2;