[openib-general] [PATCH] opensm: make some local functions static

Sasha Khapyorsky sashak at voltaire.com
Mon May 8 14:37:07 PDT 2006


This patch makes some local functions static. One unused function was
cleaned up, other currently unused was masked.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---

 osm/opensm/osm_node_info_rcv.c |   24 +++++++++---------
 osm/opensm/osm_port_info_rcv.c |    2 +-
 osm/opensm/osm_sw_info_rcv.c   |   52 +++++-----------------------------------
 3 files changed, 20 insertions(+), 58 deletions(-)

diff --git a/osm/opensm/osm_node_info_rcv.c b/osm/opensm/osm_node_info_rcv.c
index 0b8a78f..943c352 100644
--- a/osm/opensm/osm_node_info_rcv.c
+++ b/osm/opensm/osm_node_info_rcv.c
@@ -74,7 +74,7 @@ #include <opensm/osm_msgdef.h>
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_set_links(
   IN const osm_ni_rcv_t* const p_rcv,
   osm_node_t* p_node,
@@ -287,7 +287,7 @@ __osm_ni_rcv_set_links(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_new_node(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -352,7 +352,7 @@ __osm_ni_rcv_process_new_node(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_get_node_desc(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -412,7 +412,7 @@ __osm_ni_rcv_get_node_desc(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_new_ca(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -438,7 +438,7 @@ __osm_ni_rcv_process_new_ca(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_ca_port(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -586,7 +586,7 @@ __osm_ni_rcv_process_ca_port(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_existing_ca(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -602,7 +602,7 @@ __osm_ni_rcv_process_existing_ca(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_new_router(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -617,7 +617,7 @@ __osm_ni_rcv_process_new_router(
 
 /**********************************************************************
  **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_switch(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -666,7 +666,7 @@ __osm_ni_rcv_process_switch(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_existing_switch(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -713,7 +713,7 @@ __osm_ni_rcv_process_existing_switch(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_new_switch(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -739,7 +739,7 @@ __osm_ni_rcv_process_new_switch(
 /**********************************************************************
  The plock must NOT be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_new(
   IN const osm_ni_rcv_t* const p_rcv,
   IN const osm_madw_t* const p_madw )
@@ -908,7 +908,7 @@ __osm_ni_rcv_process_new(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_ni_rcv_process_existing(
   IN const osm_ni_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
diff --git a/osm/opensm/osm_port_info_rcv.c b/osm/opensm/osm_port_info_rcv.c
index 658d99e..bc75e71 100644
--- a/osm/opensm/osm_port_info_rcv.c
+++ b/osm/opensm/osm_port_info_rcv.c
@@ -510,7 +510,7 @@ void osm_pkey_get_tables(
 
 /**********************************************************************
  **********************************************************************/
-void
+static void
 __osm_pi_rcv_get_pkey_slvl_vla_tables(
   IN const osm_pi_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
diff --git a/osm/opensm/osm_sw_info_rcv.c b/osm/opensm/osm_sw_info_rcv.c
index cefcf28..ee7c744 100644
--- a/osm/opensm/osm_sw_info_rcv.c
+++ b/osm/opensm/osm_sw_info_rcv.c
@@ -63,49 +63,9 @@ #include <opensm/osm_subnet.h>
 #include <opensm/osm_helper.h>
 
 /**********************************************************************
- **********************************************************************/
-void
-__osm_si_rcv_clear_sc_bit(
-  IN const osm_si_rcv_t* const p_rcv,
-  IN osm_node_t* const p_node,
-  IN ib_switch_info_t* const p_si )
-{
-  uint8_t payload[IB_SMP_DATA_SIZE];
-  ib_api_status_t status;
-  osm_madw_context_t context;
-  OSM_LOG_ENTER( p_rcv->p_log, __osm_si_rcv_clear_sc_bit );
-
-  context.si_context.node_guid = osm_node_get_node_guid( p_node );
-  context.si_context.set_method = TRUE;
-  context.si_context.light_sweep = FALSE;
-
-  cl_memcpy( payload, p_si, IB_SMP_DATA_SIZE );
-
-  status = osm_req_set( p_rcv->p_req,
-                        osm_node_get_any_dr_path_ptr( p_node ),
-                        payload,
-                        sizeof(payload),
-                        IB_MAD_ATTR_SWITCH_INFO,
-                        0,
-                        CL_DISP_MSGID_NONE,
-                        &context );
-
-  if( status != IB_SUCCESS )
-  {
-    osm_log( p_rcv->p_log, OSM_LOG_ERROR,
-             "__osm_si_rcv_clear_sc_bit: ERR 3601: "
-             "Unable to clear state change bit for switch "
-             "with GUID = 0x%" PRIx64 "\n",
-             cl_ntoh64( osm_node_get_node_guid( p_node ) ) );
-  }
-
-  OSM_LOG_EXIT( p_rcv->p_log );
-}
-
-/**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_si_rcv_get_port_info(
   IN const osm_si_rcv_t* const p_rcv,
   IN osm_switch_t* const p_sw,
@@ -178,7 +138,7 @@ __osm_si_rcv_get_port_info(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+static void
 __osm_si_rcv_get_fwd_tbl(
   IN const osm_si_rcv_t* const p_rcv,
   IN osm_switch_t* const p_sw )
@@ -242,7 +202,8 @@ __osm_si_rcv_get_fwd_tbl(
 /**********************************************************************
  The plock must be held before calling this function.
 **********************************************************************/
-void
+#if 0
+static void
 __osm_si_rcv_get_mcast_fwd_tbl(
   IN const osm_si_rcv_t* const p_rcv,
   IN osm_switch_t* const p_sw )
@@ -347,11 +308,12 @@ __osm_si_rcv_get_mcast_fwd_tbl(
  Exit:
   OSM_LOG_EXIT( p_rcv->p_log );
 }
+#endif
 
 /**********************************************************************
    Lock must be held on entry to this function.
 **********************************************************************/
-void
+static void
 __osm_si_rcv_process_new(
   IN const osm_si_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,
@@ -462,7 +424,7 @@ #endif
    Return 1 if the caller is expected to send a change_detected event.
    this can not be done internally as the event needs the lock...
 **********************************************************************/
-boolean_t
+static boolean_t
 __osm_si_rcv_process_existing(
   IN const osm_si_rcv_t* const p_rcv,
   IN osm_node_t* const p_node,



More information about the general mailing list