diff mbox

[opensm] osm_mcast_mgr.c: removed mcast_mgr_purge_tree_node due to code duplication

Message ID 52A8B9D8.90706@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock Dec. 11, 2013, 7:15 p.m. UTC
From: Daniel Klein <danielk@mellanox.com>

Removed mcast_mgr_purge_tree_node from osm_mcast_mgr.c and replaced the
calls to it, with calls to osm_mtree_destroy.

Signed-off-by: Daniel Klein <danielk@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 opensm/osm_mcast_mgr.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)
diff mbox

Patch

diff --git a/opensm/osm_mcast_mgr.c b/opensm/osm_mcast_mgr.c
index ed14330..ea2a32a 100644
--- a/opensm/osm_mcast_mgr.c
+++ b/opensm/osm_mcast_mgr.c
@@ -133,29 +133,12 @@  void osm_mcast_drop_port_list(cl_qlist_t * list)
 				      cl_qlist_remove_head(list));
 }
 
-/**********************************************************************
- Recursively remove nodes from the tree
- *********************************************************************/
-static void mcast_mgr_purge_tree_node(IN osm_mtree_node_t * p_mtn)
-{
-	uint8_t i;
-
-	for (i = 0; i < p_mtn->max_children; i++) {
-		if (p_mtn->child_array[i] &&
-		    (p_mtn->child_array[i] != OSM_MTREE_LEAF))
-			mcast_mgr_purge_tree_node(p_mtn->child_array[i]);
-		p_mtn->child_array[i] = NULL;
-	}
-
-	free(p_mtn);
-}
-
 void osm_purge_mtree(osm_sm_t * sm, IN osm_mgrp_box_t * mbox)
 {
 	OSM_LOG_ENTER(sm->p_log);
 
 	if (mbox->root)
-		mcast_mgr_purge_tree_node(mbox->root);
+		osm_mtree_destroy(mbox->root);
 	mbox->root = NULL;
 
 	OSM_LOG_EXIT(sm->p_log);