diff mbox

opensm/osm_mcast_mgr: simplify alloc_mfts()

Message ID 20091029191828.GC20136@me (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sasha Khapyorsky Oct. 29, 2009, 7:18 p.m. UTC
None
diff mbox

Patch

diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
index a5e9758..faa0c4b 100644
--- a/opensm/opensm/osm_mcast_mgr.c
+++ b/opensm/opensm/osm_mcast_mgr.c
@@ -1048,17 +1048,12 @@  static int alloc_mfts(osm_sm_t * sm)
 	int i;
 	cl_map_item_t *item;
 	osm_switch_t *p_sw;
-	int max_mlid = 0;
 
 	for (i = sm->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO; i >= 0;
-	     i--) {
-		if (sm->p_subn->mgroups[i]) {
-			max_mlid = i + IB_LID_MCAST_START_HO;
+	     i--)
+		if (sm->p_subn->mgroups[i])
 			break;
-		}
-	}
-
-	if (max_mlid == 0)
+	if (i < 0)
 		return 0;
 
 	/* Now, walk switches and (re)allocate multicast tables */
@@ -1066,8 +1061,7 @@  static int alloc_mfts(osm_sm_t * sm)
 	     item != cl_qmap_end(&sm->p_subn->sw_guid_tbl);
 	     item = cl_qmap_next(item)) {
 		p_sw = (osm_switch_t *)item;
-		if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl,
-					  max_mlid - IB_LID_MCAST_START_HO))
+		if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl, i))
 			return -1;
 	}
 	return 0;