Remove local duplicated __osm_*_get_port_by_guid() wrappers, use instead
common osm_get_port_by_guid().

Signed-off-by: Sasha Khapyorsky <[EMAIL PROTECTED]>
---
 opensm/opensm/osm_sa_lft_record.c     |   24 ++----------------------
 opensm/opensm/osm_sa_mft_record.c     |   20 +-------------------
 opensm/opensm/osm_sa_sw_info_record.c |   22 +---------------------
 3 files changed, 4 insertions(+), 62 deletions(-)

diff --git a/opensm/opensm/osm_sa_lft_record.c 
b/opensm/opensm/osm_sa_lft_record.c
index b67430c..1fcb934 100644
--- a/opensm/opensm/osm_sa_lft_record.c
+++ b/opensm/opensm/osm_sa_lft_record.c
@@ -113,26 +113,6 @@ Exit:
 
 /**********************************************************************
  **********************************************************************/
-static osm_port_t *__osm_lftr_get_port_by_guid(IN osm_sa_t * sa,
-                                              IN uint64_t port_guid)
-{
-       osm_port_t *p_port;
-
-       CL_PLOCK_ACQUIRE(sa->p_lock);
-
-       p_port = osm_get_port_by_guid(sa->p_subn, port_guid);
-       if (!p_port) {
-               OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "ERR 4404: "
-                       "Invalid port GUID 0x%016" PRIx64 "\n", port_guid);
-               p_port = NULL;
-       }
-
-       CL_PLOCK_RELEASE(sa->p_lock);
-       return p_port;
-}
-
-/**********************************************************************
- **********************************************************************/
 static void
 __osm_lftr_rcv_by_comp_mask(IN cl_map_item_t * const p_map_item,
                            IN void *context)
@@ -150,8 +130,8 @@ __osm_lftr_rcv_by_comp_mask(IN cl_map_item_t * const 
p_map_item,
        const osm_physp_t *p_physp;
 
        /* In switches, the port guid is the node guid. */
-       p_port =
-           __osm_lftr_get_port_by_guid(sa, p_sw->p_node->node_info.port_guid);
+       p_port = osm_get_port_by_guid(sa->p_subn,
+                                     p_sw->p_node->node_info.port_guid);
        if (!p_port) {
                OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4405: "
                        "Failed to find Port by Node Guid:0x%016" PRIx64
diff --git a/opensm/opensm/osm_sa_mft_record.c 
b/opensm/opensm/osm_sa_mft_record.c
index b97e95d..8e04705 100644
--- a/opensm/opensm/osm_sa_mft_record.c
+++ b/opensm/opensm/osm_sa_mft_record.c
@@ -117,24 +117,6 @@ Exit:
 
 /**********************************************************************
  **********************************************************************/
-static osm_port_t *__osm_mftr_get_port_by_guid(IN osm_sa_t * sa,
-                                              IN uint64_t port_guid)
-{
-       osm_port_t *p_port;
-
-       CL_PLOCK_ACQUIRE(sa->p_lock);
-
-       p_port = osm_get_port_by_guid(sa->p_subn, port_guid);
-       if (!p_port)
-               OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "ERR 4A04: "
-                       "Invalid port GUID 0x%016" PRIx64 "\n", port_guid);
-
-       CL_PLOCK_RELEASE(sa->p_lock);
-       return p_port;
-}
-
-/**********************************************************************
- **********************************************************************/
 static void
 __osm_mftr_rcv_by_comp_mask(IN cl_map_item_t * const p_map_item,
                            IN void *context)
@@ -155,7 +137,7 @@ __osm_mftr_rcv_by_comp_mask(IN cl_map_item_t * const 
p_map_item,
 
        /* In switches, the port guid is the node guid. */
        p_port =
-           __osm_mftr_get_port_by_guid(sa, p_sw->p_node->node_info.port_guid);
+           osm_get_port_by_guid(sa->p_subn, p_sw->p_node->node_info.port_guid);
        if (!p_port) {
                OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4A05: "
                        "Failed to find Port by Node Guid:0x%016" PRIx64
diff --git a/opensm/opensm/osm_sa_sw_info_record.c 
b/opensm/opensm/osm_sa_sw_info_record.c
index 3a3667c..9a3c112 100644
--- a/opensm/opensm/osm_sa_sw_info_record.c
+++ b/opensm/opensm/osm_sa_sw_info_record.c
@@ -105,26 +105,6 @@ Exit:
 
 /**********************************************************************
  **********************************************************************/
-static osm_port_t *__osm_sir_get_port_by_guid(IN osm_sa_t * sa,
-                                             IN uint64_t port_guid)
-{
-       osm_port_t *p_port;
-
-       CL_PLOCK_ACQUIRE(sa->p_lock);
-
-       p_port = osm_get_port_by_guid(sa->p_subn, port_guid);
-       if (!p_port) {
-               OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "ERR 5309: "
-                       "Invalid port GUID 0x%016" PRIx64 "\n", port_guid);
-               p_port = NULL;
-       }
-
-       CL_PLOCK_RELEASE(sa->p_lock);
-       return p_port;
-}
-
-/**********************************************************************
- **********************************************************************/
 static void
 __osm_sir_rcv_create_sir(IN osm_sa_t * sa,
                         IN const osm_switch_t * const p_sw,
@@ -147,7 +127,7 @@ __osm_sir_rcv_create_sir(IN osm_sa_t * sa,
 
        /* In switches, the port guid is the node guid. */
        p_port =
-           __osm_sir_get_port_by_guid(sa, p_sw->p_node->node_info.port_guid);
+           osm_get_port_by_guid(sa->p_subn, p_sw->p_node->node_info.port_guid);
        if (!p_port) {
                OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 530A: "
                        "Failed to find Port by Node Guid:0x%016" PRIx64
-- 
1.5.5.1.178.g1f811

_______________________________________________
general mailing list
general@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to