From patchwork Wed Dec 11 19:15:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3327881 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 797F2C0D4A for ; Wed, 11 Dec 2013 19:15:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58DBB20523 for ; Wed, 11 Dec 2013 19:15:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C7C7207F2 for ; Wed, 11 Dec 2013 19:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206Ab3LKTPo (ORCPT ); Wed, 11 Dec 2013 14:15:44 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:61030 "EHLO mail-ee0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752202Ab3LKTPj (ORCPT ); Wed, 11 Dec 2013 14:15:39 -0500 Received: by mail-ee0-f45.google.com with SMTP id d49so3044367eek.18 for ; Wed, 11 Dec 2013 11:15:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=zW95yf7D4PIKESZOAQyglKihsGnsQrBMHGOnLAyIa3I=; b=eU04DEN7NtAzDfAAgLlJ3w+e2sDG382A2BloOxR/a738LmguwCT2wxo8YKrzqp0duI 86vHoNMb/EGtd30bqdF8Rrm6V0p569DWhuhobi9hiLcU9lQ9iRbDuosJwjvp1kTD3CRT 0bMInrEErambqXUz0OIycvD805qCPSvmdBCzh7K2AkmmkG+QzwSbJmIRBBFTRnlUf6Sx RJFFHZwgSP4yUnojeYE8iV29k1OuEnbotZnpSK2g9kL9K8plDUQzRBTrbwFWNPc6GCd7 QjJ0XEMcOvnZeRPblrcLIRP9htNq/h3iNu1LNgditI81vaVT7RgZj7rWg0asUE46dBo3 MyWQ== X-Gm-Message-State: ALoCoQkmYTGNrv83Hgjtbm9hgR2UsEEHzlluJoN6NqDHwUgZN44sjQw5CPZqpwAbrOSfkabvPK2g X-Received: by 10.14.69.200 with SMTP id n48mr3627925eed.54.1386789338381; Wed, 11 Dec 2013 11:15:38 -0800 (PST) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id b41sm56898037eef.16.2013.12.11.11.15.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 11:15:37 -0800 (PST) Message-ID: <52A8B9D8.90706@dev.mellanox.co.il> Date: Wed, 11 Dec 2013 14:15:36 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Daniel Klein Subject: [PATCH opensm] osm_mcast_mgr.c: removed mcast_mgr_purge_tree_node due to code duplication Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Klein 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 Signed-off-by: Hal Rosenstock --- opensm/osm_mcast_mgr.c | 20 +------------------- 1 files changed, 1 insertions(+), 19 deletions(-) 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);