Hey Sasha,
As I began working on the switch balancing console option, I noticed
that '0xff' was hard coded in a lot of places and OSM_NO_PATH is the
macro used later on. This patch tries to clean some of this up by using
OSM_NO_PATH consistently. Nothing fancy.
Al
--
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From 06be52ceafc980cead2473d093db1a74f5921c35 Mon Sep 17 00:00:00 2001
From: Albert L. Chu <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2008 17:08:50 -0700
Subject: [PATCH] use OSM_NO_PATH instead of hard coded 0xff when appropriate
Signed-off-by: Albert L. Chu <[EMAIL PROTECTED]>
---
opensm/include/opensm/osm_lin_fwd_tbl.h | 2 +-
opensm/opensm/osm_switch.c | 6 +++---
opensm/opensm/osm_ucast_file.c | 2 +-
opensm/opensm/osm_ucast_mgr.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/opensm/include/opensm/osm_lin_fwd_tbl.h b/opensm/include/opensm/osm_lin_fwd_tbl.h
index c43ee15..c3db69a 100644
--- a/opensm/include/opensm/osm_lin_fwd_tbl.h
+++ b/opensm/include/opensm/osm_lin_fwd_tbl.h
@@ -210,7 +210,7 @@ osm_lin_fwd_tbl_get(IN const osm_lin_fwd_tbl_t * const p_tbl,
if (lid_ho < p_tbl->size)
return (p_tbl->port_tbl[lid_ho]);
else
- return (0xFF);
+ return (OSM_NO_PATH);
}
/*
diff --git a/opensm/opensm/osm_switch.c b/opensm/opensm/osm_switch.c
index 55e16d1..c962be7 100644
--- a/opensm/opensm/osm_switch.c
+++ b/opensm/opensm/osm_switch.c
@@ -68,7 +68,7 @@ osm_switch_set_hops(IN osm_switch_t * const p_sw,
p_sw->hops[lid_ho] = malloc(p_sw->num_ports);
if (!p_sw->hops[lid_ho])
return -1;
- memset(p_sw->hops[lid_ho], 0xff, p_sw->num_ports);
+ memset(p_sw->hops[lid_ho], OSM_NO_PATH, p_sw->num_ports);
}
p_sw->hops[lid_ho][port_num] = num_hops;
@@ -194,7 +194,7 @@ osm_switch_get_fwd_tbl_block(IN const osm_switch_t * const p_sw,
if (base_lid_ho <= max_lid_ho) {
/* Initialize LIDs in block to invalid port number. */
- memset(p_block, 0xff, IB_SMP_DATA_SIZE);
+ memset(p_block, OSM_NO_PATH, IB_SMP_DATA_SIZE);
/*
Determine the range of LIDs we can return with this block.
*/
@@ -580,7 +580,7 @@ void osm_switch_clear_hops(IN osm_switch_t * p_sw)
for (i = 0; i < p_sw->num_hops; i++)
if (p_sw->hops[i])
- memset(p_sw->hops[i], 0xff, p_sw->num_ports);
+ memset(p_sw->hops[i], OSM_NO_PATH, p_sw->num_ports);
}
/**********************************************************************
diff --git a/opensm/opensm/osm_ucast_file.c b/opensm/opensm/osm_ucast_file.c
index 3b0349d..a6b82f3 100644
--- a/opensm/opensm/osm_ucast_file.c
+++ b/opensm/opensm/osm_ucast_file.c
@@ -200,7 +200,7 @@ static int do_ucast_file_load(void *context)
cl_ntoh64(sw_guid));
continue;
}
- memset(p_osm->sm.ucast_mgr.lft_buf, 0xff,
+ memset(p_osm->sm.ucast_mgr.lft_buf, OSM_NO_PATH,
IB_LID_UCAST_END_HO + 1);
} else if (p_sw && !strncmp(p, "0x", 2)) {
p += 2;
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index 9b27f41..98ae65d 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -489,7 +489,7 @@ __osm_ucast_mgr_process_tbl(IN cl_map_item_t * const p_map_item,
}
/* Initialize LIDs in buffer to invalid port number. */
- memset(p_mgr->lft_buf, 0xff, IB_LID_UCAST_END_HO + 1);
+ memset(p_mgr->lft_buf, OSM_NO_PATH, IB_LID_UCAST_END_HO + 1);
p_port_tbl = &p_mgr->p_subn->port_guid_tbl;
--
1.5.1
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general