remove 'dist' field from ibnd_node_t, which was virtually not used
PATCH 2/2 remove 'dist' field from ibnd_node_t, which was virtually not used
Remove the 'dist' field from the ibnd_node_t struct and rearch code appropriately. It ends up this field was only used to pass a value from create_node() to add_to_nodedist(), of which create_node() is the only function that calls add_to_nodedist(). In other words, it served pretty much no purpose.
Al
Signature · 5 lines
Albert Chu [email protected] Computer Scientist High Performance Systems Division Lawrence Livermore National Laboratory
From: Albert Chu <[email protected]>
Date: Wed, 28 Oct 2009 16:18:39 -0700
Subject: [PATCH] remove 'dist' field from ibnd_node_t, which was virtually not used
--- .../libibnetdisc/include/infiniband/ibnetdisc.h | 1 - infiniband-diags/libibnetdisc/src/ibnetdisc.c | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-)
infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h +0 -1
@@ -48,7 +48,6 @@ typedef struct ibnd_node {struct ibnd_node *next;/* all node list in fabric */ ib_portid_t path_portid;/* path from "from_node" */ -int dist;/* num of hops from "from_node" */ int smalid;int smalmc;
infiniband-diags/libibnetdisc/src/ibnetdisc.c +2 -4
@@ -387,9 +387,8 @@ static void add_to_type_list(ibnd_node_t * node, ibnd_fabric_t * fabric) } } -static void add_to_nodedist (ibnd_node_t * node,ibnd_scan_t * ibnd_scan) +static void add_to_nodedist (ibnd_node_t * node,ibnd_scan_t * ibnd_scan,int dist) { -int dist = node->dist;if (node->type !=IB_NODE_SWITCH ) dist =MAXHOPS ;/* special Ca list */
@@ -410,7 +409,6 @@ static ibnd_node_t *create_node(ibnd_fabric_t * fabric, ibnd_scan_t * ibnd_scan, }memcpy (node, temp,sizeof (*node)); - node->dist = dist; node->path_portid = *path;add_to_nodeguid_hash (node, fabric->nodestbl);
@@ -420,7 +418,7 @@ static ibnd_node_t *create_node(ibnd_fabric_t * fabric, ibnd_scan_t * ibnd_scan, fabric->nodes = (ibnd_node_t *) node;add_to_type_list (node, fabric); -add_to_nodedist (node, ibnd_scan); +add_to_nodedist (node, ibnd_scan, dist);return node; }
Signature · 1 line
1.5.4.5
A message that is not in the archive (sent off-list or not yet received): 1256773931.4819.192.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org
Sasha Khapyorsky
AppliedQuoted 6 lines · Al Chu
Remove the 'dist' field from the
ibnd_node_tstruct and rearch code appropriately. It ends up this field was only used to pass a value fromcreate_node()toadd_to_nodedist(), of whichcreate_node()is the only function that callsadd_to_nodedist(). In other words, it served pretty much no purpose.
Quoted 15 lines
Al
Signature · 12 lines
Albert Chu [email protected] Computer Scientist High Performance Systems Division Lawrence Livermore National Laboratory From: Albert Chu <[email protected]> Date: Wed, 28 Oct 2009 16:18:39 -0700 Subject: [PATCH] remove 'dist' field from ibnd_node_t, which was virtually not used Signed-off-by: Albert Chu <[email protected]>
Applied. Thanks.
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html