[ofa-general] [PATCH] opensm: more osm_*_construct/_init/_destroy cleanups

Sasha Khapyorsky sashak at voltaire.com
Thu May 10 15:43:08 PDT 2007


Hi Hal,

As suggested :)


This removes/makes static non used osm_*_construct/_init/_destroy
initializers for OpenSM objects where osm*_new/_delete are actually
used.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/include/opensm/osm_inform.h      |   57 ++---------------
 osm/include/opensm/osm_lin_fwd_tbl.h |    5 +-
 osm/include/opensm/osm_mcm_info.h    |   93 +--------------------------
 osm/include/opensm/osm_mcm_port.h    |  117 +++-------------------------------
 osm/include/opensm/osm_mtree.h       |   88 -------------------------
 osm/include/opensm/osm_multicast.h   |  104 ++----------------------------
 osm/include/opensm/osm_router.h      |  106 ++----------------------------
 osm/include/opensm/osm_service.h     |   39 ++---------
 osm/opensm/osm_inform.c              |   32 +--------
 osm/opensm/osm_mcast_mgr.c           |    2 +-
 osm/opensm/osm_mcm_info.c            |   23 +------
 osm/opensm/osm_mcm_port.c            |   28 +--------
 osm/opensm/osm_mtree.c               |    4 +-
 osm/opensm/osm_multicast.c           |   18 +----
 osm/opensm/osm_router.c              |   46 +------------
 osm/opensm/osm_sa_mcmember_record.c  |    4 +-
 osm/opensm/osm_sa_service_record.c   |    4 +-
 osm/opensm/osm_service.c             |   13 +---
 osm/opensm/osm_subnet.c              |    4 +-
 19 files changed, 64 insertions(+), 723 deletions(-)

diff --git a/osm/include/opensm/osm_inform.h b/osm/include/opensm/osm_inform.h
index 3e8e122..57ab05c 100644
--- a/osm/include/opensm/osm_inform.h
+++ b/osm/include/opensm/osm_inform.h
@@ -154,57 +154,12 @@ osm_infr_new(
 *	Allows calling other service record methods.
 *
 * SEE ALSO
-*	Inform Record, osm_infr_construct, osm_infr_destroy
+*	Inform Record, osm_infr_delete
 *********/
 
-/****f* OpenSM: Inform Record/osm_infr_init
+/****f* OpenSM: Inform Record/osm_infr_delete
 * NAME
-*	osm_infr_new
-*
-* DESCRIPTION
-*	Initializes the osm_infr_t structure.
-*
-* SYNOPSIS
-*/
-void
-osm_infr_init(
-	IN osm_infr_t* const p_infr,
-	IN const osm_infr_t *p_infr_rec );
-/*
-* PARAMETERS
-*	p_infr
-*		[in] Pointer to osm_infr_t structure
-*	p_inf_rec
-*		[in] Pointer to the ib_inform_info_record_t
-*
-* SEE ALSO
-*	Inform Record, osm_infr_construct, osm_infr_destroy
-*********/
-
-/****f* OpenSM: Inform Record/osm_infr_construct
-* NAME
-*	osm_infr_construct
-*
-* DESCRIPTION
-*	Constructs the osm_infr_t structure.
-*
-* SYNOPSIS
-*/
-void
-osm_infr_construct(
-	IN osm_infr_t* const p_infr );
-/*
-* PARAMETERS
-*	p_infr
-*		[in] Pointer to osm_infr_t structure
-*
-* SEE ALSO
-*	Inform Record, osm_infr_construct, osm_infr_destroy
-*********/
-
-/****f* OpenSM: Inform Record/osm_infr_destroy
-* NAME
-*	osm_infr_destroy
+*	osm_infr_delete
 *
 * DESCRIPTION
 *	Constructs the osm_infr_t structure.
@@ -212,7 +167,7 @@ osm_infr_construct(
 * SYNOPSIS
 */
 void
-osm_infr_destroy(
+osm_infr_delete(
 	IN osm_infr_t* const p_infr );
 /*
 * PARAMETERS
@@ -220,7 +175,7 @@ osm_infr_destroy(
 *		[in] Pointer to osm_infr_t structure
 *
 * SEE ALSO
-*	Inform Record, osm_infr_construct, osm_infr_destroy
+*	Inform Record, osm_infr_new
 *********/
 
 /****f* OpenSM: Inform Record/osm_infr_get_by_rec
@@ -251,7 +206,7 @@ osm_infr_get_by_rec(
 * RETURN
 *	The matching osm_infr_t
 * SEE ALSO
-*	Inform Record, osm_infr_construct, osm_infr_destroy
+*	Inform Record, osm_infr_new, osm_infr_delete
 *********/
 
 void
diff --git a/osm/include/opensm/osm_lin_fwd_tbl.h b/osm/include/opensm/osm_lin_fwd_tbl.h
index e059020..26d0465 100644
--- a/osm/include/opensm/osm_lin_fwd_tbl.h
+++ b/osm/include/opensm/osm_lin_fwd_tbl.h
@@ -93,9 +93,8 @@ BEGIN_C_DECLS
 */
 typedef struct _osm_lin_fwd_tbl
 {
-	uint16_t				size;
-	uint8_t					port_tbl[1];
-
+	uint16_t	size;
+	uint8_t		port_tbl[1];
 } osm_lin_fwd_tbl_t;
 /*
 * FIELDS
diff --git a/osm/include/opensm/osm_mcm_info.h b/osm/include/opensm/osm_mcm_info.h
index b6f6ee2..48d61f5 100644
--- a/osm/include/opensm/osm_mcm_info.h
+++ b/osm/include/opensm/osm_mcm_info.h
@@ -79,9 +79,8 @@ BEGIN_C_DECLS
 */
 typedef struct _osm_mcm_info
 {
-	cl_list_item_t				list_item;
-	ib_net16_t					mlid;
-
+	cl_list_item_t	list_item;
+	ib_net16_t	mlid;
 } osm_mcm_info_t;
 /*
 * FIELDS
@@ -94,94 +93,6 @@ typedef struct _osm_mcm_info
 * SEE ALSO
 *********/
 
-/****f* OpenSM: Multicast Member Info/osm_mcm_info_construct
-* NAME
-*	osm_mcm_info_construct
-*
-* DESCRIPTION
-*	This function constructs a Multicast Member Info object.
-*
-* SYNOPSIS
-*/
-static inline void
-osm_mcm_info_construct(
-	IN osm_mcm_info_t* const p_mcm )
-{
-	memset( p_mcm, 0, sizeof(*p_mcm) );
-}
-/*
-* PARAMETERS
-*	p_mcm
-*		[in] Pointer to a Multicast Member Info object to construct.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Multicast Member Info/osm_mcm_info_destroy
-* NAME
-*	osm_mcm_info_destroy
-*
-* DESCRIPTION
-*	The osm_mcm_info_destroy function destroys the object, releasing
-*	all resources.
-*
-* SYNOPSIS
-*/
-void
-osm_mcm_info_destroy(
-	IN osm_mcm_info_t* const p_mcm );
-/*
-* PARAMETERS
-*	p_mcm
-*		[in] Pointer to a Multicast Member Info object to destroy.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Performs any necessary cleanup of the specified Multicast Member Info object.
-*	Further operations should not be attempted on the destroyed object.
-*	This function should only be called after a call to osm_mtree_construct or
-*	osm_mtree_init.
-*
-* SEE ALSO
-*	Multicast Member Info object, osm_mtree_construct, osm_mtree_init
-*********/
-
-/****f* OpenSM: Multicast Member Info/osm_mcm_info_init
-* NAME
-*	osm_mcm_info_init
-*
-* DESCRIPTION
-*	Initializes a Multicast Member Info object for use.
-*
-* SYNOPSIS
-*/
-void
-osm_mcm_info_init(
-	IN osm_mcm_info_t* const p_mcm,
-	IN const ib_net16_t mlid );
-/*
-* PARAMETERS
-*	p_mcm
-*		[in] Pointer to an osm_mcm_info_t object to initialize.
-*
-*	mlid
-*		[in] MLID value for this multicast group.
-*
-* RETURN VALUES
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
 /****f* OpenSM: Multicast Member Info/osm_mcm_info_new
 * NAME
 *	osm_mcm_info_new
diff --git a/osm/include/opensm/osm_mcm_port.h b/osm/include/opensm/osm_mcm_port.h
index df30b84..634b3c7 100644
--- a/osm/include/opensm/osm_mcm_port.h
+++ b/osm/include/opensm/osm_mcm_port.h
@@ -103,112 +103,13 @@ typedef struct _osm_mcm_port
 *	MCM Port Object
 *********/
 
-/****f* OpenSM: MCM Port Object/osm_mcm_port_construct
+/****f* OpenSM: MCM Port Object/osm_mcm_port_new
 * NAME
-*	osm_mcm_port_construct
+*	osm_mcm_port_new
 *
 * DESCRIPTION
-*	This function constructs a MCM Port object.
-*
-* SYNOPSIS
-*/
-void
-osm_mcm_port_construct(
-	IN osm_mcm_port_t* const p_mcm );
-/*
-* PARAMETERS
-*	p_mcm
-*		[in] Pointer to a MCM Port Object to construct.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Allows calling osm_mcm_port_init, osm_mcm_port_destroy.
-*
-*	Calling osm_mcm_port_construct is a prerequisite to calling any other
-*	method except osm_mcm_port_init.
-*
-* SEE ALSO
-*	MCM Port Object, osm_mcm_port_init, osm_mcm_port_destroy
-*********/
-
-/****f* OpenSM: MCM Port Object/osm_mcm_port_destroy
-* NAME
-*	osm_mcm_port_destroy
-*
-* DESCRIPTION
-*	The osm_mcm_port_destroy function destroys a MCM Port Object, releasing
-*	all resources.
-*
-* SYNOPSIS
-*/
-void
-osm_mcm_port_destroy(
-	IN osm_mcm_port_t* const p_mcm );
-/*
-* PARAMETERS
-*	p_mcm
-*		[in] Pointer to a MCM Port Object to destroy.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Performs any necessary cleanup of the specified MCM Port Object.
-*	Further operations should not be attempted on the destroyed object.
-*	This function should only be called after a call to
-*	osm_mcm_port_construct or osm_mcm_port_init.
-*
-* SEE ALSO
-*	MCM Port Object, osm_mcm_port_construct, osm_mcm_port_init
-*********/
-
-/****f* OpenSM: MCM Port Object/osm_mcm_port_init
-* NAME
-*	osm_mcm_port_init
-*
-* DESCRIPTION
-*	The osm_mcm_port_init function initializes a MCM Port Object for use.
-*
-* SYNOPSIS
-*/
-void
-osm_mcm_port_init(
-	IN osm_mcm_port_t* const p_mcm,
-	IN const ib_gid_t* const p_port_gid,
-	IN const uint8_t   scope_state,
-   IN const boolean_t proxy_join );
-/*
-* PARAMETERS
-*	p_mcm
-*		[in] Pointer to an osm_mcm_port_t object to initialize.
-*
-*	p_port_gid
-*		[in] Pointer to the GID of the port to add to the multicast group.
-*
-*	scope_state
-*		[in] scope state of the join request
-*
-*  proxy_join
-*     [in] proxy_join state analyzed from the request
-*
-* RETURN VALUES
-*	None.
-*
-* NOTES
-*	Allows calling other MCM Port Object methods.
-*
-* SEE ALSO
-*	MCM Port Object, osm_mcm_port_construct, osm_mcm_port_destroy,
-*********/
-
-/****f* OpenSM: MCM Port Object/osm_mcm_port_init
-* NAME
-*	osm_mcm_port_init
-*
-* DESCRIPTION
-*	The osm_mcm_port_init function initializes a MCM Port Object for use.
+*	The osm_mcm_port_new function allocates and initializes a
+*	MCM Port Object for use.
 *
 * SYNOPSIS
 */
@@ -234,15 +135,15 @@ osm_mcm_port_new(
 * NOTES
 *
 * SEE ALSO
-*	MCM Port Object, osm_mcm_port_construct, osm_mcm_port_destroy,
+*	MCM Port Object, osm_mcm_port_delete,
 *********/
 
-/****f* OpenSM: MCM Port Object/osm_mcm_port_destroy
+/****f* OpenSM: MCM Port Object/osm_mcm_port_delete
 * NAME
-*	osm_mcm_port_destroy
+*	osm_mcm_port_delete
 *
 * DESCRIPTION
-*	The osm_mcm_port_destroy function destroys and dellallocates an
+*	The osm_mcm_port_delete function destroys and dellallocates an
 *	MCM Port Object, releasing all resources.
 *
 * SYNOPSIS
@@ -261,7 +162,7 @@ osm_mcm_port_delete(
 * NOTES
 *
 * SEE ALSO
-*	MCM Port Object, osm_mcm_port_construct, osm_mcm_port_init
+*	MCM Port Object, osm_mcm_port_new
 *********/
 
 END_C_DECLS
diff --git a/osm/include/opensm/osm_mtree.h b/osm/include/opensm/osm_mtree.h
index d349dc8..aa02cbb 100644
--- a/osm/include/opensm/osm_mtree.h
+++ b/osm/include/opensm/osm_mtree.h
@@ -138,94 +138,6 @@ typedef struct _osm_mtree_node
 * SEE ALSO
 *********/
 
-/****f* OpenSM: Multicast Tree/osm_mtree_node_construct
-* NAME
-*	osm_mtree_node_construct
-*
-* DESCRIPTION
-*	This function constructs a Multicast Tree Node object.
-*
-* SYNOPSIS
-*/
-static inline void
-osm_mtree_node_construct(
-	IN osm_mtree_node_t* const p_mtn )
-{
-	memset( p_mtn, 0, sizeof(*p_mtn) );
-}
-/*
-* PARAMETERS
-*	p_mtn
-*		[in] Pointer to a Multicast Tree Node object to construct.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Multicast Tree/osm_mtree_node_destroy
-* NAME
-*	osm_mtree_node_destroy
-*
-* DESCRIPTION
-*	The osm_mtree_node_destroy function destroys a node, releasing
-*	all resources.
-*
-* SYNOPSIS
-*/
-void
-osm_mtree_node_destroy(
-	IN osm_mtree_node_t* const p_mtn );
-/*
-* PARAMETERS
-*	p_mtn
-*		[in] Pointer to a Multicast Tree Node object to destroy.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Performs any necessary cleanup of the specified Multicast Tree object.
-*	Further operations should not be attempted on the destroyed object.
-*	This function should only be called after a call to osm_mtree_construct or
-*	osm_mtree_init.
-*
-* SEE ALSO
-*	Multicast Tree object, osm_mtree_construct, osm_mtree_init
-*********/
-
-/****f* OpenSM: Multicast Tree/osm_mtree_node_init
-* NAME
-*	osm_mtree_node_init
-*
-* DESCRIPTION
-*	Initializes a Multicast Tree Node object for use.
-*
-* SYNOPSIS
-*/
-void
-osm_mtree_node_init(
-	IN osm_mtree_node_t* const p_mtn,
-	IN const osm_switch_t* const p_sw );
-/*
-* PARAMETERS
-*	p_mtn
-*		[in] Pointer to an osm_mtree_node_t object to initialize.
-*
-*	p_sw
-*		[in] Pointer to the switch represented by this node.
-*
-* RETURN VALUES
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
 /****f* OpenSM: Multicast Tree/osm_mtree_node_new
 * NAME
 *	osm_mtree_node_new
diff --git a/osm/include/opensm/osm_multicast.h b/osm/include/opensm/osm_multicast.h
index b247e01..13a6fd1 100644
--- a/osm/include/opensm/osm_multicast.h
+++ b/osm/include/opensm/osm_multicast.h
@@ -126,9 +126,9 @@ osm_get_mcast_req_type_str(
 */
 typedef struct osm_mcast_mgr_ctxt
 {
-  ib_net16_t						mlid;
-  osm_mcast_req_type_t        req_type;
-  ib_net64_t                  port_guid;
+	ib_net16_t		mlid;
+	osm_mcast_req_type_t	req_type;
+	ib_net64_t		port_guid;
 } osm_mcast_mgr_ctxt_t;
 /*
 * FIELDS
@@ -246,98 +246,6 @@ typedef	void (*osm_mgrp_func_t)(
 * SEE ALSO
 *********/
 
-/****f* OpenSM: Multicast Group/osm_mgrp_construct
-* NAME
-*	osm_mgrp_construct
-*
-* DESCRIPTION
-*	This function constructs a Multicast Group.
-*
-* SYNOPSIS
-*/
-void
-osm_mgrp_construct(
-	IN osm_mgrp_t* const p_mgrp );
-/*
-* PARAMETERS
-*	p_mgrp
-*		[in] Pointer to a Multicast Group to construct.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Allows calling osm_mgrp_init, osm_mgrp_destroy.
-*
-*	Calling osm_mgrp_construct is a prerequisite to calling any other
-*	method except osm_mgrp_init.
-*
-* SEE ALSO
-*	Multicast Group, osm_mgrp_init, osm_mgrp_destroy
-*********/
-
-/****f* OpenSM: Multicast Group/osm_mgrp_destroy
-* NAME
-*	osm_mgrp_destroy
-*
-* DESCRIPTION
-*	The osm_mgrp_destroy function destroys a Multicast Group, releasing
-*	all resources.
-*
-* SYNOPSIS
-*/
-void
-osm_mgrp_destroy(
-	IN osm_mgrp_t* const p_mgrp );
-/*
-* PARAMETERS
-*	p_mgrp
-*		[in] Pointer to a Muticast Group to destroy.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Performs any necessary cleanup of the specified Multicast Group.
-*	Further operations should not be attempted on the destroyed object.
-*	This function should only be called after a call to osm_mgrp_construct or
-*	osm_mgrp_init.
-*
-* SEE ALSO
-*	Multicast Group, osm_mgrp_construct, osm_mgrp_init
-*********/
-
-/****f* OpenSM: Multicast Group/osm_mgrp_init
-* NAME
-*	osm_mgrp_init
-*
-* DESCRIPTION
-*	The osm_mgrp_init function initializes a Multicast Group for use.
-*
-* SYNOPSIS
-*/
-void
-osm_mgrp_init(
-	IN osm_mgrp_t* const p_mgrp,
-	IN const ib_net16_t mlid );
-/*
-* PARAMETERS
-*	p_mgrp
-*		[in] Pointer to an osm_mgrp_t object to initialize.
-*
-*	mlid
-*		[in] Multicast LID for this multicast group.
-*
-* RETURN VALUES
-*	None.
-*
-* NOTES
-*	Allows calling other Multicast Group methods.
-*
-* SEE ALSO
-*	Multicast Group, osm_mgrp_construct, osm_mgrp_destroy,
-*********/
-
 /****f* OpenSM: Multicast Group/osm_mgrp_new
 * NAME
 *	osm_mgrp_new
@@ -362,7 +270,7 @@ osm_mgrp_new(
 *	Allows calling other Multicast Group methods.
 *
 * SEE ALSO
-*	Multicast Group, osm_mgrp_construct, osm_mgrp_destroy,
+*	Multicast Group, osm_mgrp_delete,
 *********/
 
 /****f* OpenSM: Multicast Group/osm_mgrp_delete
@@ -388,7 +296,7 @@ osm_mgrp_delete(
 * NOTES
 *
 * SEE ALSO
-*	Multicast Group, osm_mgrp_construct, osm_mgrp_destroy,
+*	Multicast Group, osm_mgrp_new
 *********/
 
 /****f* OpenSM: Multicast Group/osm_mgrp_is_guid
@@ -568,7 +476,7 @@ osm_mgrp_is_port_present(
 void
 osm_mgrp_remove_port(
 	IN osm_subn_t* const p_subn,
-   IN osm_log_t* const p_log,
+	IN osm_log_t* const p_log,
 	IN osm_mgrp_t* const p_mgrp,
 	IN const ib_net64_t port_guid );
 /*
diff --git a/osm/include/opensm/osm_router.h b/osm/include/opensm/osm_router.h
index 49c5b46..db1dc13 100644
--- a/osm/include/opensm/osm_router.h
+++ b/osm/include/opensm/osm_router.h
@@ -100,8 +100,8 @@ BEGIN_C_DECLS
 */
 typedef struct _osm_router
 {
-	cl_map_item_t				map_item;
-	osm_port_t				*p_port;
+	cl_map_item_t	map_item;
+	osm_port_t	*p_port;
 } osm_router_t;
 /*
 * FIELDS
@@ -115,70 +115,9 @@ typedef struct _osm_router
 *	Router object
 *********/
 
-/****f* OpenSM: Router/osm_router_construct
+/****f* OpenSM: Router/osm_router_delete
 * NAME
-*	osm_router_construct
-*
-* DESCRIPTION
-*	This function constructs a Router object.
-*
-* SYNOPSIS
-*/
-void
-osm_router_construct(
-	IN osm_router_t* const p_rtr );
-/*
-* PARAMETERS
-*	p_rtr
-*		[in] Pointer to a Router object to construct.
-*
-* RETURN VALUE
-*	This function does not return a value.
-*
-* NOTES
-*	Allows calling osm_router_init, and osm_router_destroy.
-*
-*	Calling osm_router_construct is a prerequisite to calling any other
-*	method except osm_router_init.
-*
-* SEE ALSO
-*	Router object, osm_router_init, osm_router_destroy
-*********/
-
-/****f* OpenSM: Router/osm_router_destroy
-* NAME
-*	osm_router_destroy
-*
-* DESCRIPTION
-*	The osm_router_destroy function destroys the object, releasing
-*	all resources.
-*
-* SYNOPSIS
-*/
-void
-osm_router_destroy(
-	IN osm_router_t* const p_rtr );
-/*
-* PARAMETERS
-*	p_rtr
-*		[in] Pointer to the object to destroy.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*	Performs any necessary cleanup of the specified object.
-*	Further operations should not be attempted on the destroyed object.
-*	This function should only be called after a call to osm_router_construct
-*	or osm_router_init.
-*
-* SEE ALSO
-*	Router object, osm_router_construct, osm_router_init
-*********/
-
-/****f* OpenSM: Router/osm_router_destroy
-* NAME
-*	osm_router_destroy
+*	osm_router_delete
 *
 * DESCRIPTION
 *	Destroys and deallocates the object.
@@ -199,38 +138,7 @@ osm_router_delete(
 * NOTES
 *
 * SEE ALSO
-*	Router object, osm_router_construct, osm_router_init
-*********/
-
-/****f* OpenSM: Router/osm_router_init
-* NAME
-*	osm_router_init
-*
-* DESCRIPTION
-*	The osm_router_init function initializes a Router object for use.
-*
-* SYNOPSIS
-*/
-ib_api_status_t
-osm_router_init(
-	IN osm_router_t* const p_rtr,
-	IN osm_port_t* const p_port );
-/*
-* PARAMETERS
-*	p_rtr
-*		[in] Pointer to an osm_router_t object to initialize.
-*
-*	p_port
-*		[in] Pointer to the port object of this router 
-*
-* RETURN VALUES
-*	IB_SUCCESS if the Router object was initialized successfully.
-*
-* NOTES
-*	Allows calling other node methods.
-*
-* SEE ALSO
-*	Router object, osm_router_construct, osm_router_destroy
+*	Router object, osm_router_new
 *********/
 
 /****f* OpenSM: Router/osm_router_new
@@ -238,7 +146,7 @@ osm_router_init(
 *	osm_router_new
 *
 * DESCRIPTION
-*	The osm_router_init function initializes a Router object for use.
+*	The osm_router_new function initializes a Router object for use.
 *
 * SYNOPSIS
 */
@@ -256,7 +164,7 @@ osm_router_new(
 * NOTES
 *
 * SEE ALSO
-*	Router object, osm_router_construct, osm_router_destroy,
+*	Router object, osm_router_new,
 *********/
 
 /****f* OpenSM: Router/osm_router_get_port_ptr
diff --git a/osm/include/opensm/osm_service.h b/osm/include/opensm/osm_service.h
index 2470650..7c7434c 100644
--- a/osm/include/opensm/osm_service.h
+++ b/osm/include/opensm/osm_service.h
@@ -146,13 +146,13 @@ osm_svcr_new(
 *	Allows calling other service record methods.
 *
 * SEE ALSO
-*	Service Record, osm_svcr_construct, osm_svcr_destroy
+*	Service Record, osm_svcr_delete
 *********/
 
 
 /****f* OpenSM: Service Record/osm_svcr_init
 * NAME
-*	osm_svcr_new
+*	osm_svcr_init
 *
 * DESCRIPTION
 *	Initializes the osm_svcr_t structure.
@@ -171,41 +171,20 @@ osm_svcr_init(
 *		[in] Pointer to the ib_service_record_t
 *
 * SEE ALSO
-*	Service Record, osm_svcr_construct, osm_svcr_destroy
-*********/
-
-/****f* OpenSM: Service Record/osm_svcr_construct
-* NAME
-*	osm_svcr_construct
-*
-* DESCRIPTION
-*	Constructs the osm_svcr_t structure.
-*
-* SYNOPSIS
-*/
-void
-osm_svcr_construct(
-	IN osm_svcr_t* const p_svcr );
-/*
-* PARAMETERS
-*	p_svc_rec
-*		[in] Pointer to osm_svcr_t structure
-*
-* SEE ALSO
-*	Service Record, osm_svcr_construct, osm_svcr_destroy
+*	Service Record
 *********/
 
-/****f* OpenSM: Service Record/osm_svcr_destroy
+/****f* OpenSM: Service Record/osm_svcr_delete
 * NAME
-*	osm_svcr_destroy
+*	osm_svcr_delete
 *
 * DESCRIPTION
-*	Constructs the osm_svcr_t structure.
+*	Deallocates the osm_svcr_t structure.
 *
 * SYNOPSIS
 */
 void
-osm_svcr_destroy(
+osm_svcr_delete(
 	IN osm_svcr_t* const p_svcr );
 /*
 * PARAMETERS
@@ -213,11 +192,9 @@ osm_svcr_destroy(
 *		[in] Pointer to osm_svcr_t structure
 *
 * SEE ALSO
-*	Service Record, osm_svcr_construct, osm_svcr_destroy
+*	Service Record, osm_svcr_new
 *********/
 
-
-
 osm_svcr_t*
 osm_svcr_get_by_rid(
 	IN osm_subn_t	const	*p_subn,
diff --git a/osm/opensm/osm_inform.c b/osm/opensm/osm_inform.c
index e66c259..0069b59 100644
--- a/osm/opensm/osm_inform.c
+++ b/osm/opensm/osm_inform.c
@@ -67,16 +67,7 @@ typedef struct _osm_infr_match_ctxt
 /**********************************************************************
  **********************************************************************/
 void
-osm_infr_construct(
-  IN osm_infr_t* const p_infr )
-{
-  memset( p_infr, 0, sizeof(osm_infr_t) );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_infr_destroy(
+osm_infr_delete(
   IN osm_infr_t* const p_infr )
 {
   free( p_infr );
@@ -84,21 +75,6 @@ osm_infr_destroy(
 
 /**********************************************************************
  **********************************************************************/
-void
-osm_infr_init(
-  IN osm_infr_t* const p_infr,
-  IN const osm_infr_t *p_infr_rec  )
-{
-  CL_ASSERT( p_infr );
-
-  /* what else do we need in the inform_record ??? */
-
-  /* copy the contents of the provided informinfo */
-  memcpy( p_infr, p_infr_rec, sizeof(osm_infr_t) );
-}
-
-/**********************************************************************
- **********************************************************************/
 osm_infr_t*
 osm_infr_new(
   IN const osm_infr_t *p_infr_rec )
@@ -109,9 +85,7 @@ osm_infr_new(
 
   p_infr = (osm_infr_t*)malloc( sizeof(osm_infr_t) );
   if( p_infr )
-  {
-    osm_infr_init( p_infr, p_infr_rec );
-  }
+    memcpy( p_infr, p_infr_rec, sizeof(osm_infr_t) );
 
   return( p_infr );
 }
@@ -369,7 +343,7 @@ osm_infr_remove_from_db(
   cl_qlist_remove_item( &p_subn->sa_infr_list,
                         &p_infr->list_item );
 
-  osm_infr_destroy( p_infr );
+  osm_infr_delete( p_infr );
 
   OSM_LOG_EXIT( p_log );
 }
diff --git a/osm/opensm/osm_mcast_mgr.c b/osm/opensm/osm_mcast_mgr.c
index f5059c9..508dd72 100644
--- a/osm/opensm/osm_mcast_mgr.c
+++ b/osm/opensm/osm_mcast_mgr.c
@@ -1697,7 +1697,7 @@ osm_mcast_mgr_process_mgrp_cb(
       cl_qmap_remove_item(&p_mgr->p_subn->mgrp_mlid_tbl,
                           (cl_map_item_t *)p_mgrp );
 
-      osm_mgrp_destroy(p_mgrp);
+      osm_mgrp_delete(p_mgrp);
     }
   }
 
diff --git a/osm/opensm/osm_mcm_info.c b/osm/opensm/osm_mcm_info.c
index f250c36..a550a1c 100644
--- a/osm/opensm/osm_mcm_info.c
+++ b/osm/opensm/osm_mcm_info.c
@@ -55,26 +55,6 @@
 
 /**********************************************************************
  **********************************************************************/
-void
-osm_mcm_info_destroy(
-  IN osm_mcm_info_t* const p_mcm )
-{
-  CL_ASSERT( p_mcm );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_mcm_info_init(
-  IN osm_mcm_info_t* const p_mcm,
-  IN const ib_net16_t mlid )
-{
-  CL_ASSERT( p_mcm );
-  p_mcm->mlid = mlid;
-}
-
-/**********************************************************************
- **********************************************************************/
 osm_mcm_info_t*
 osm_mcm_info_new(
   IN const ib_net16_t mlid )
@@ -85,7 +65,7 @@ osm_mcm_info_new(
   if( p_mcm )
   {
     memset(p_mcm, 0, sizeof(*p_mcm) );
-    osm_mcm_info_init( p_mcm, mlid );
+    p_mcm->mlid = mlid;
   }
 
   return( p_mcm );
@@ -97,6 +77,5 @@ void
 osm_mcm_info_delete(
   IN osm_mcm_info_t* const p_mcm )
 {
-  osm_mcm_info_destroy( p_mcm );
   free( p_mcm );
 }
diff --git a/osm/opensm/osm_mcm_port.c b/osm/opensm/osm_mcm_port.c
index b617a9e..9e4dfe0 100644
--- a/osm/opensm/osm_mcm_port.c
+++ b/osm/opensm/osm_mcm_port.c
@@ -56,39 +56,16 @@
 
 /**********************************************************************
  **********************************************************************/
-void
-osm_mcm_port_construct(
-  IN osm_mcm_port_t* const p_mcm )
-{
-  memset( p_mcm, 0, sizeof(*p_mcm) );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_mcm_port_destroy(
-  IN osm_mcm_port_t* const p_mcm )
-{
-  /*
-    Nothing to do?
-  */
-  UNUSED_PARAM( p_mcm );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
+static void
 osm_mcm_port_init(
   IN osm_mcm_port_t* const p_mcm,
   IN const ib_gid_t* const p_port_gid,
   IN const uint8_t   scope_state,
   IN const boolean_t proxy_join )
 {
-  CL_ASSERT( p_mcm );
   CL_ASSERT( p_port_gid );
   CL_ASSERT( scope_state );
 
-  osm_mcm_port_construct( p_mcm );
   p_mcm->port_gid = *p_port_gid;
   p_mcm->scope_state = scope_state;
   p_mcm->proxy_join = proxy_join;
@@ -107,6 +84,7 @@ osm_mcm_port_new(
   p_mcm = malloc( sizeof(*p_mcm) );
   if( p_mcm )
   {
+    memset( p_mcm, 0, sizeof(*p_mcm) );
     osm_mcm_port_init( p_mcm, p_port_gid,
                        scope_state, proxy_join );
   }
@@ -121,7 +99,5 @@ osm_mcm_port_delete(
   IN osm_mcm_port_t* const p_mcm )
 {
   CL_ASSERT( p_mcm );
-
-  osm_mcm_port_destroy( p_mcm );
   free( p_mcm );
 }
diff --git a/osm/opensm/osm_mtree.c b/osm/opensm/osm_mtree.c
index 90576d3..c69f46c 100644
--- a/osm/opensm/osm_mtree.c
+++ b/osm/opensm/osm_mtree.c
@@ -55,7 +55,7 @@
 
 /**********************************************************************
  **********************************************************************/
-void
+static void
 osm_mtree_node_init(
   IN osm_mtree_node_t*     const p_mtn,
   IN const osm_switch_t*      const p_sw )
@@ -65,7 +65,7 @@ osm_mtree_node_init(
   CL_ASSERT( p_mtn );
   CL_ASSERT( p_sw );
 
-  osm_mtree_node_construct( p_mtn );
+  memset( p_mtn, 0, sizeof(*p_mtn) );
 
   p_mtn->p_sw = (osm_switch_t*)p_sw;
   p_mtn->max_children = p_sw->num_ports;
diff --git a/osm/opensm/osm_multicast.c b/osm/opensm/osm_multicast.c
index 2538a9a..db79fcd 100644
--- a/osm/opensm/osm_multicast.c
+++ b/osm/opensm/osm_multicast.c
@@ -77,17 +77,7 @@ osm_get_mcast_req_type_str(
 /**********************************************************************
  **********************************************************************/
 void
-osm_mgrp_construct(
-  IN osm_mgrp_t* const p_mgrp )
-{
-  memset( p_mgrp, 0, sizeof(*p_mgrp) );
-  cl_qmap_init( &p_mgrp->mcm_port_tbl );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_mgrp_destroy(
+osm_mgrp_delete(
   IN osm_mgrp_t* const p_mgrp )
 {
   osm_mcm_port_t *p_mcm_port;
@@ -110,15 +100,15 @@ osm_mgrp_destroy(
 
 /**********************************************************************
  **********************************************************************/
-void
+static void
 osm_mgrp_init(
   IN osm_mgrp_t* const p_mgrp,
   IN const ib_net16_t mlid )
 {
-  CL_ASSERT( p_mgrp );
   CL_ASSERT( cl_ntoh16( mlid ) >= IB_LID_MCAST_START_HO );
 
-  osm_mgrp_construct( p_mgrp );
+  memset( p_mgrp, 0, sizeof(*p_mgrp) );
+  cl_qmap_init( &p_mgrp->mcm_port_tbl );
   p_mgrp->mlid = mlid;
   p_mgrp->last_change_id = 0;
   p_mgrp->last_tree_id = 0;
diff --git a/osm/opensm/osm_router.c b/osm/opensm/osm_router.c
index 4b6470c..544afec 100644
--- a/osm/opensm/osm_router.c
+++ b/osm/opensm/osm_router.c
@@ -50,54 +50,15 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <complib/cl_math.h>
 #include <iba/ib_types.h>
 #include <opensm/osm_router.h>
 
 /**********************************************************************
  **********************************************************************/
 void
-osm_router_construct(
-  IN osm_router_t* const p_rtr )
-{
-  CL_ASSERT( p_rtr );
-  memset( p_rtr, 0, sizeof(*p_rtr) );
-}
-
-/**********************************************************************
- **********************************************************************/
-ib_api_status_t
-osm_router_init(
-  IN osm_router_t* const p_rtr,
-  IN osm_port_t*   const p_port )
-{
-  ib_api_status_t  status = IB_SUCCESS;
-
-  CL_ASSERT( p_rtr );
-  CL_ASSERT( p_port );
-
-  osm_router_construct( p_rtr );
-
-  p_rtr->p_port = p_port;
-
-  return( status );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_router_destroy(
-  IN osm_router_t* const p_rtr )
-{
-}
-
-/**********************************************************************
- **********************************************************************/
-void
 osm_router_delete(
   IN OUT osm_router_t** const pp_rtr )
 {
-  osm_router_destroy( *pp_rtr );
   free( *pp_rtr );
   *pp_rtr = NULL;
 }
@@ -108,16 +69,15 @@ osm_router_t*
 osm_router_new(
   IN osm_port_t* const p_port )
 {
-  ib_api_status_t status;
   osm_router_t *p_rtr;
 
+  CL_ASSERT( p_port );
+
   p_rtr = (osm_router_t*)malloc( sizeof(*p_rtr) );
   if( p_rtr )
   {
     memset( p_rtr, 0, sizeof(*p_rtr) );
-    status = osm_router_init( p_rtr, p_port );
-    if( status != IB_SUCCESS )
-      osm_router_delete( &p_rtr );
+    p_rtr->p_port = p_port;
   }
 
   return( p_rtr );
diff --git a/osm/opensm/osm_sa_mcmember_record.c b/osm/opensm/osm_sa_mcmember_record.c
index 8241129..d27de5e 100644
--- a/osm/opensm/osm_sa_mcmember_record.c
+++ b/osm/opensm/osm_sa_mcmember_record.c
@@ -419,7 +419,7 @@ __cleanup_mgrp(
     {
       cl_qmap_remove_item(&p_rcv->p_subn->mgrp_mlid_tbl,
                           (cl_map_item_t *)p_mgrp );
-      osm_mgrp_destroy(p_mgrp);
+      osm_mgrp_delete(p_mgrp);
     }
   }
 }
@@ -1358,7 +1358,7 @@ osm_mcmr_rcv_create_new_mgrp(
              cl_ntoh16(mlid) );
     cl_qmap_remove_item(&p_rcv->p_subn->mgrp_mlid_tbl,
                         (cl_map_item_t *)p_prev_mgrp );
-    osm_mgrp_destroy( p_prev_mgrp );
+    osm_mgrp_delete( p_prev_mgrp );
   }
 
   cl_qmap_insert(&p_rcv->p_subn->mgrp_mlid_tbl,
diff --git a/osm/opensm/osm_sa_service_record.c b/osm/opensm/osm_sa_service_record.c
index eff0b0a..ded1cd2 100644
--- a/osm/opensm/osm_sa_service_record.c
+++ b/osm/opensm/osm_sa_service_record.c
@@ -1038,7 +1038,7 @@ osm_sr_rcv_process_delete_method(
   cl_qlist_insert_tail( &sr_list, (cl_list_item_t*)&p_sr_item->pool_item );
 
   if(p_svcr)
-    osm_svcr_destroy(p_svcr);
+    osm_svcr_delete(p_svcr);
 
   __osm_sr_rcv_respond( p_rcv, p_madw, &sr_list );
 
@@ -1186,7 +1186,7 @@ osm_sr_rcv_lease_cb(
                               p_rcv->p_log,
                               p_svcr);
 
-      osm_svcr_destroy(p_svcr);
+      osm_svcr_delete(p_svcr);
 
       p_list_item = p_next_list_item;
       continue;
diff --git a/osm/opensm/osm_service.c b/osm/opensm/osm_service.c
index e97d8c6..ba422b3 100644
--- a/osm/opensm/osm_service.c
+++ b/osm/opensm/osm_service.c
@@ -56,16 +56,7 @@
 /**********************************************************************
  **********************************************************************/
 void
-osm_svcr_construct(
-  IN osm_svcr_t* const p_svcr )
-{
-  memset( p_svcr, 0, sizeof(*p_svcr) );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_svcr_destroy(
+osm_svcr_delete(
   IN osm_svcr_t* const p_svcr )
 {
   free( p_svcr);
@@ -102,7 +93,7 @@ osm_svcr_new(
   p_svcr = (osm_svcr_t*)malloc( sizeof(*p_svcr) );
   if( p_svcr )
   {
-    osm_svcr_construct( p_svcr );
+    memset( p_svcr, 0, sizeof(*p_svcr) );
     osm_svcr_init( p_svcr, p_svc_rec );
   }
 
diff --git a/osm/opensm/osm_subnet.c b/osm/opensm/osm_subnet.c
index 0484530..855d1ab 100644
--- a/osm/opensm/osm_subnet.c
+++ b/osm/opensm/osm_subnet.c
@@ -158,7 +158,7 @@ osm_subn_destroy(
   {
     p_mgrp = p_next_mgrp;
     p_next_mgrp = (osm_mgrp_t*)cl_qmap_next( &p_mgrp->map_item );
-    osm_mgrp_destroy( p_mgrp );
+    osm_mgrp_delete( p_mgrp );
   }
 
   p_next_infr = (osm_infr_t*)cl_qlist_head( &p_subn->sa_infr_list );
@@ -166,7 +166,7 @@ osm_subn_destroy(
   {
     p_infr = p_next_infr;
     p_next_infr = (osm_infr_t*)cl_qlist_next( &p_infr->list_item );
-    osm_infr_destroy( p_infr );
+    osm_infr_delete( p_infr );
   }
 
   cl_list_remove_all( &p_subn->new_ports_list );
-- 
1.5.2.rc2.20.gac2a




More information about the general mailing list