From patchwork Tue Nov 17 18:16:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 60761 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAHIGHMM024275 for ; Tue, 17 Nov 2009 18:16:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbZKQSQJ (ORCPT ); Tue, 17 Nov 2009 13:16:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752736AbZKQSQJ (ORCPT ); Tue, 17 Nov 2009 13:16:09 -0500 Received: from nspiron-1.llnl.gov ([128.115.41.81]:35238 "EHLO nspiron-1.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbZKQSQI (ORCPT ); Tue, 17 Nov 2009 13:16:08 -0500 X-Attachments: 0001-remove-unnecessary-casting-in-libibnetdiscover.patch Received: from auk31.llnl.gov (HELO [134.9.93.159]) ([134.9.93.159]) by nspiron-1.llnl.gov with ESMTP; 17 Nov 2009 10:16:14 -0800 Subject: [infiniband-diags] [PATCH] [1/3] remove unnecessary casting in libibnetdiscover From: Al Chu Reply-To: chu11@llnl.gov To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Date: Tue, 17 Nov 2009 10:16:14 -0800 Message-Id: <1258481774.1335.95.camel@auk31.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/infiniband-diags/libibnetdisc/src/chassis.c b/infiniband-diags/libibnetdisc/src/chassis.c index 3bd0108..a8b6767 100644 --- a/infiniband-diags/libibnetdisc/src/chassis.c +++ b/infiniband-diags/libibnetdisc/src/chassis.c @@ -346,30 +346,28 @@ char anafa_spine4_slot_2_slb[25] = { /* reference { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */ -static int get_sfb_slot(ibnd_node_t * node, ibnd_port_t * lineport) +static int get_sfb_slot(ibnd_node_t * n, ibnd_port_t * lineport) { - ibnd_node_t *n = (ibnd_node_t *) node; - n->ch_slot = SPINE_CS; - if (is_spine_9096(node)) { + if (is_spine_9096(n)) { n->ch_type = ISR9096_CT; n->ch_slotnum = spine4_slot_2_slb[lineport->portnum]; n->ch_anafanum = anafa_spine4_slot_2_slb[lineport->portnum]; - } else if (is_spine_9288(node)) { + } else if (is_spine_9288(n)) { n->ch_type = ISR9288_CT; n->ch_slotnum = spine12_slot_2_slb[lineport->portnum]; n->ch_anafanum = anafa_spine12_slot_2_slb[lineport->portnum]; - } else if (is_spine_2012(node)) { + } else if (is_spine_2012(n)) { n->ch_type = ISR2012_CT; n->ch_slotnum = spine12_slot_2_slb[lineport->portnum]; n->ch_anafanum = anafa_spine12_slot_2_slb[lineport->portnum]; - } else if (is_spine_2004(node)) { + } else if (is_spine_2004(n)) { n->ch_type = ISR2004_CT; n->ch_slotnum = spine4_slot_2_slb[lineport->portnum]; n->ch_anafanum = anafa_spine4_slot_2_slb[lineport->portnum]; } else { IBND_ERROR("Unexpected node found: guid 0x%016" PRIx64, - node->guid); + n->guid); return -1; } return 0; @@ -653,7 +651,7 @@ static int build_chassis(ibnd_node_t * node, ibnd_chassis_t * chassis) ibnd_port_t *port = 0; /* we get here with node = chassis_spine */ - if (insert_spine((ibnd_node_t *) node, chassis)) + if (insert_spine(node, chassis)) return -1; /* loop: pass on all ports of node */ @@ -874,8 +872,7 @@ int group_nodes(ibnd_fabric_t * fabric, ibnd_scan_t *scan) if (mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F)) { chassis = - find_chassisguid(fabric, - (ibnd_node_t *) node); + find_chassisguid(fabric, node); if (chassis) chassis->nodecount++; else { @@ -883,8 +880,7 @@ int group_nodes(ibnd_fabric_t * fabric, ibnd_scan_t *scan) if (add_chassis(scan)) goto cleanup; scan->current_chassis->chassisguid = - get_chassisguid((ibnd_node_t *) - node); + get_chassisguid(node); scan->current_chassis->nodecount = 1; } } @@ -902,8 +898,7 @@ int group_nodes(ibnd_fabric_t * fabric, ibnd_scan_t *scan) if (mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F)) { chassis = - find_chassisguid(fabric, - (ibnd_node_t *) node); + find_chassisguid(fabric, node); if (chassis && chassis->nodecount > 1) { if (!chassis->chassisnum) chassis->chassisnum = @@ -911,8 +906,7 @@ int group_nodes(ibnd_fabric_t * fabric, ibnd_scan_t *scan) if (!node->ch_found) { node->ch_found = 1; add_node_to_chassis(chassis, - (ibnd_node_t - *) node); + node); } } }