[ofa-general] Re: [PATCH] opensm/ucast_cache: remove redundant osm_physp_is_valid() check
Yevgeny Kliteynik
kliteyn at dev.mellanox.co.il
Thu Oct 9 18:07:04 PDT 2008
Hi Sasha,
Sasha Khapyorsky wrote:
> osm_node_get_physp_ptr() return non-NULL values only for valid physical
> ports - remove redundant checks.
Looks fine, thanks.
-- Yevgeny
> 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,
More information about the general
mailing list