[ofa-general] [PATCH][TRIVIAL] opensm/osm_port_profile: No need to inline some functions

Hal Rosenstock hrosenstock at xsigo.com
Wed Jun 18 08:18:05 PDT 2008


pensm/osm_port_profile: No need to inline osm_port_prof_is_ignored_port
and osm_port_prof_set_ignored_port functions

Also, some cosmetic formatting changes

Signed-off-by: Hal Rosenstock <hal at xsigo.com>

diff --git a/opensm/include/opensm/osm_port_profile.h b/opensm/include/opensm/osm_port_profile.h
index 9997d0b..6777e15 100644
--- a/opensm/include/opensm/osm_port_profile.h
+++ b/opensm/include/opensm/osm_port_profile.h
@@ -114,7 +114,6 @@ static inline void osm_port_prof_construct(IN osm_port_profile_t * const p_prof)
 	CL_ASSERT(p_prof);
 	memset(p_prof, 0, sizeof(*p_prof));
 }
-
 /*
 * PARAMETERS
 *	p_prof
@@ -144,7 +143,6 @@ osm_port_prof_path_count_inc(IN osm_port_profile_t * const p_prof)
 	CL_ASSERT(p_prof);
 	p_prof->num_paths++;
 }
-
 /*
 * PARAMETERS
 *	p_prof
@@ -172,7 +170,6 @@ osm_port_prof_path_count_get(IN const osm_port_profile_t * const p_prof)
 {
 	return (p_prof->num_paths);
 }
-
 /*
 * PARAMETERS
 *	p_prof
@@ -196,22 +193,9 @@ osm_port_prof_path_count_get(IN const osm_port_profile_t * const p_prof)
 *
 * SYNOPSIS
 */
-static inline boolean_t
+boolean_t
 osm_port_prof_is_ignored_port(IN const osm_subn_t * p_subn,
-			      IN ib_net64_t port_guid, IN uint8_t port_num)
-{
-	const cl_map_t *p_map = &p_subn->port_prof_ignore_guids;
-	const void *p_obj = cl_map_get(p_map, port_guid);
-	size_t res;
-
-	// HACK: we currently support ignoring ports 0 - 31
-	if (p_obj != NULL) {
-		res = (size_t) p_obj & (size_t) (1 << port_num);
-		return (res != 0);
-	}
-	return FALSE;
-}
-
+			      IN ib_net64_t port_guid, IN uint8_t port_num);
 /*
 * PARAMETERS
 *	p_subn
@@ -237,26 +221,9 @@ osm_port_prof_is_ignored_port(IN const osm_subn_t * p_subn,
 *
 * SYNOPSIS
 */
-static inline void
+void
 osm_port_prof_set_ignored_port(IN osm_subn_t * p_subn,
-			       IN ib_net64_t port_guid, IN uint8_t port_num)
-{
-	cl_map_t *p_map = &p_subn->port_prof_ignore_guids;
-	const void *p_obj = cl_map_get(p_map, port_guid);
-	size_t value = 0;
-
-	// HACK: we currently support ignoring ports 0 - 31
-	CL_ASSERT(port_num < 32);
-
-	if (p_obj != NULL) {
-		value = (size_t) p_obj;
-		cl_map_remove(p_map, port_guid);
-	}
-
-	value = value | (1 << port_num);
-	cl_map_insert(p_map, port_guid, (void *)value);
-}
-
+			       IN ib_net64_t port_guid, IN uint8_t port_num);
 /*
 * PARAMETERS
 *	p_subn
diff --git a/opensm/opensm/osm_port.c b/opensm/opensm/osm_port.c
index 18f1ef2..f8a411e 100644
--- a/opensm/opensm/osm_port.c
+++ b/opensm/opensm/osm_port.c
@@ -756,14 +756,14 @@ osm_physp_set_pkey_tbl(IN osm_log_t * p_log,
 
 	CL_ASSERT(p_pkey_tbl);
 	/*
-	   (14.2.5.7) - the block number valid values are 0-2047, and are further
-	   limited by the size of the P_Key table specified by the PartitionCap on the
-	   node.
+	   (14.2.5.7) - the block number valid values are 0-2047, and are
+	   further limited by the size of the P_Key table specified by the
+	   the PartitionCap on the node.
 	 */
 	if (!p_physp->p_node->sw || p_physp->port_num == 0)
 		/*
-		   The maximum blocks is defined in the node info: partition cap for CA,
-		   routers and switch management ports.
+		   The maximum blocks is defined in the node info: partition cap
+		   for CA, router, and switch management ports.
 		 */
 		max_blocks =
 		    (cl_ntoh16(p_physp->p_node->node_info.partition_cap) +
@@ -771,8 +771,9 @@ osm_physp_set_pkey_tbl(IN osm_log_t * p_log,
 		    / IB_NUM_PKEY_ELEMENTS_IN_BLOCK;
 	else
 		/*
-		   This is a switch, and not a management port. The maximum blocks is defined
-		   in the switch info: partition enforcement cap.
+		   This is a switch, and not a management port. The maximum
+		   blocks is defined in the switch info: partition enforcement
+		   cap.
 		 */
 		max_blocks =
 		    (cl_ntoh16(p_physp->p_node->sw->switch_info.enforce_cap) +
@@ -791,3 +792,43 @@ osm_physp_set_pkey_tbl(IN osm_log_t * p_log,
 
 	osm_pkey_tbl_set(&p_physp->pkeys, block_num, p_pkey_tbl);
 }
+
+/**********************************************************************
+ **********************************************************************/
+boolean_t
+osm_port_prof_is_ignored_port(IN const osm_subn_t * p_subn,
+			      IN ib_net64_t port_guid, IN uint8_t port_num)
+{
+	const cl_map_t *p_map = &p_subn->port_prof_ignore_guids;
+	const void *p_obj = cl_map_get(p_map, port_guid);
+	size_t res;
+
+	// HACK: we currently support ignoring ports 0 - 31
+	if (p_obj != NULL) {
+		res = (size_t) p_obj & (size_t) (1 << port_num);
+		return (res != 0);
+	}
+	return FALSE;
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+osm_port_prof_set_ignored_port(IN osm_subn_t * p_subn,
+			       IN ib_net64_t port_guid, IN uint8_t port_num)
+{
+	cl_map_t *p_map = &p_subn->port_prof_ignore_guids;
+	const void *p_obj = cl_map_get(p_map, port_guid);
+	size_t value = 0;
+
+	// HACK: we currently support ignoring ports 0 - 31
+	CL_ASSERT(port_num < 32);
+
+	if (p_obj != NULL) {
+		value = (size_t) p_obj;
+		cl_map_remove(p_map, port_guid);
+	}
+
+	value = value | (1 << port_num);
+	cl_map_insert(p_map, port_guid, (void *)value);
+}





More information about the general mailing list