[ofa-general] [PATCH] opensm/ucast_cache: remove redundant osm_physp_is_valid() check
Sasha Khapyorsky
sashak at voltaire.com
Thu Oct 9 11:34:02 PDT 2008
osm_node_get_physp_ptr() return non-NULL values only for valid physical
ports - remove redundant checks.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/opensm/osm_ucast_cache.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/opensm/opensm/osm_ucast_cache.c b/opensm/opensm/osm_ucast_cache.c
index 355716a..3c32d35 100644
--- a/opensm/opensm/osm_ucast_cache.c
+++ b/opensm/opensm/osm_ucast_cache.c
@@ -963,12 +963,10 @@ osm_ucast_cache_add_link(osm_ucast_cache_t * p_cache,
goto Exit;
}
- if (((osm_node_get_type(p_node_1) == IB_NODE_TYPE_SWITCH) &&
- (!osm_node_get_physp_ptr(p_node_1, 0) ||
- !osm_physp_is_valid(osm_node_get_physp_ptr(p_node_1, 0)))) ||
- ((osm_node_get_type(p_node_2) == IB_NODE_TYPE_SWITCH) &&
- (!osm_node_get_physp_ptr(p_node_2, 0) ||
- !osm_physp_is_valid(osm_node_get_physp_ptr(p_node_2, 0))))) {
+ if ((osm_node_get_type(p_node_1) == IB_NODE_TYPE_SWITCH &&
+ !osm_node_get_physp_ptr(p_node_1, 0)) ||
+ (osm_node_get_type(p_node_2) == IB_NODE_TYPE_SWITCH &&
+ !osm_node_get_physp_ptr(p_node_2, 0))) {
/* we're caching a link when one of the nodes
has already been dropped and cached */
OSM_LOG(p_cache->p_ucast_mgr->p_log, OSM_LOG_VERBOSE,
--
1.6.0.1.196.g01914
More information about the general
mailing list