diff mbox

opensm: kill intn_t and uintn_t types

Message ID 20091004110104.GP17846@me (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sasha Khapyorsky Oct. 4, 2009, 11:01 a.m. UTC
None
diff mbox

Patch

diff --git a/opensm/complib/cl_map.c b/opensm/complib/cl_map.c
index 95d4d3b..e7d7a58 100644
--- a/opensm/complib/cl_map.c
+++ b/opensm/complib/cl_map.c
@@ -1148,7 +1148,7 @@  cl_fmap_item_t *cl_fmap_get(IN const cl_fmap_t * const p_map,
 			    IN const void *const p_key)
 {
 	cl_fmap_item_t *p_item;
-	intn_t cmp;
+	long cmp;
 
 	CL_ASSERT(p_map);
 	CL_ASSERT(p_map->state == CL_INITIALIZED);
@@ -1175,7 +1175,7 @@  cl_fmap_item_t *cl_fmap_get_next(IN const cl_fmap_t * const p_map,
 {
 	cl_fmap_item_t *p_item;
 	cl_fmap_item_t *p_item_found;
-	intn_t cmp;
+	long cmp;
 
 	CL_ASSERT(p_map);
 	CL_ASSERT(p_map->state == CL_INITIALIZED);
@@ -1273,7 +1273,7 @@  cl_fmap_item_t *cl_fmap_insert(IN cl_fmap_t * const p_map,
 			       IN cl_fmap_item_t * const p_item)
 {
 	cl_fmap_item_t *p_insert_at, *p_comp_item;
-	intn_t cmp = 0;
+	long cmp = 0;
 
 	CL_ASSERT(p_map);
 	CL_ASSERT(p_map->state == CL_INITIALIZED);
@@ -1575,7 +1575,7 @@  void cl_fmap_delta(IN OUT cl_fmap_t * const p_map1,
 		   OUT cl_fmap_t * const p_new, OUT cl_fmap_t * const p_old)
 {
 	cl_fmap_item_t *p_item1, *p_item2;
-	intn_t cmp;
+	long cmp;
 
 	CL_ASSERT(p_map1);
 	CL_ASSERT(p_map2);
diff --git a/opensm/complib/cl_pool.c b/opensm/complib/cl_pool.c
index 1f66284..53a90ce 100644
--- a/opensm/complib/cl_pool.c
+++ b/opensm/complib/cl_pool.c
@@ -128,7 +128,7 @@  cl_status_t cl_qcpool_init(IN cl_qcpool_t * const p_pool,
 		 * are aligned on a natural boundary.
 		 */
 		p_pool->component_sizes[i] =
-		    ROUNDUP(p_pool->component_sizes[i], sizeof(uintn_t));
+		    ROUNDUP(p_pool->component_sizes[i], sizeof(long));
 	}
 
 	p_pool->max_objects = max_size ? max_size : ~(size_t) 0;
diff --git a/opensm/include/complib/cl_fleximap.h b/opensm/include/complib/cl_fleximap.h
index 0af8766..da8b965 100644
--- a/opensm/include/complib/cl_fleximap.h
+++ b/opensm/include/complib/cl_fleximap.h
@@ -181,7 +181,7 @@  typedef struct _cl_fmap_item {
 *
 * SYNOPSIS
 */
-typedef intn_t
+typedef long
     (*cl_pfn_fmap_cmp_t) (IN const void *const p_key1,
 			  IN const void *const p_key2);
 /*
diff --git a/opensm/include/complib/cl_types.h b/opensm/include/complib/cl_types.h
index 84f629d..e118c4e 100644
--- a/opensm/include/complib/cl_types.h
+++ b/opensm/include/complib/cl_types.h
@@ -89,7 +89,7 @@  typedef uint64_t net64_t;
 *	The offsetof macro returns the offset of a member within a structure.
 *
 * SYNOPSIS
-*	uintn_t
+*	unsigned long
 *	offsetof(
 *		IN TYPE,
 *		IN MEMBER );
@@ -110,7 +110,7 @@  typedef uint64_t net64_t;
 *	PARENT_STRUCT
 *********/
 #ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((uintn_t) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
 #endif
 
 /****d* Component Library: Pointer Manipulation/PARENT_STRUCT
@@ -245,14 +245,6 @@  typedef uint64_t net64_t;
 *	net64_t
 *		64-bit network byte order value.
 *
-*	intn_t
-*		Signed natural sized integer.  32-bit on a 32-bit platform, 64-bit on
-*		a 64-bit platform.
-*
-*	uintn_t
-*		Unsigned natural sized integer.  32-bit on a 32-bit platform, 64-bit on
-*		a 64-bit platform.
-*
 *	boolean_t
 *		integral sized.  Set to TRUE or FALSE and used in logical expressions.
 *
diff --git a/opensm/include/complib/cl_types_osd.h b/opensm/include/complib/cl_types_osd.h
index d12aa4c..7c6e51d 100644
--- a/opensm/include/complib/cl_types_osd.h
+++ b/opensm/include/complib/cl_types_osd.h
@@ -37,8 +37,7 @@ 
  * Abstract:
  *	Defines sized datatypes for Linux User mode
  *  exported sizes are int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t
- *  int64_t, uint64_t. uintn_t is a polymorphic type, size is native size and
- *  also size of the pointer.
+ *  int64_t, uint64_t.
  */
 
 #ifndef _CL_TYPES_OSD_H_
@@ -73,8 +72,6 @@  BEGIN_C_DECLS
 /*
  * Types not explicitly defined are native to the platform.
  */
-typedef unsigned long uintn_t;
-typedef long intn_t;
 typedef int boolean_t;
 typedef volatile int32_t atomic32_t;
 
diff --git a/opensm/libvendor/osm_vendor_al.c b/opensm/libvendor/osm_vendor_al.c
index d5d78c9..a23a3a5 100644
--- a/opensm/libvendor/osm_vendor_al.c
+++ b/opensm/libvendor/osm_vendor_al.c
@@ -515,7 +515,7 @@  Exit:
 static ib_api_status_t
 __osm_vendor_get_ca_guids(IN osm_vendor_t * const p_vend,
 			  IN ib_net64_t ** const p_guids,
-			  IN uintn_t * const p_num_guids)
+			  IN unsigned long * const p_num_guids)
 {
 	ib_api_status_t status;
 
@@ -609,7 +609,7 @@  osm_vendor_get_all_port_attr(IN osm_vendor_t * const p_vend,
 	ib_api_status_t status;
 
 	uint32_t ca;
-	uintn_t ca_count;
+	unsigned long ca_count;
 	uint32_t port_count = 0;
 	uint8_t port_num;
 	uint32_t total_ports = 0;
diff --git a/opensm/libvendor/osm_vendor_ibumad_sa.c b/opensm/libvendor/osm_vendor_ibumad_sa.c
index 24146a7..7154bda 100644
--- a/opensm/libvendor/osm_vendor_ibumad_sa.c
+++ b/opensm/libvendor/osm_vendor_ibumad_sa.c
@@ -135,7 +135,7 @@  __osmv_sa_mad_rcv_cb(IN osm_madw_t * p_madw,
 			if (ib_get_attr_size(p_sa_mad->attr_offset)) {
 				/* we used the offset value to calculate the
 				   number of records in here */
-				query_res.result_cnt = (uintn_t)
+				query_res.result_cnt =
 				    ((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /
 				     ib_get_attr_size(p_sa_mad->attr_offset));
 				OSM_LOG(p_bind->p_log, OSM_LOG_DEBUG,
diff --git a/opensm/libvendor/osm_vendor_mlx_sa.c b/opensm/libvendor/osm_vendor_mlx_sa.c
index 23e16ea..3fe1113 100644
--- a/opensm/libvendor/osm_vendor_mlx_sa.c
+++ b/opensm/libvendor/osm_vendor_mlx_sa.c
@@ -147,7 +147,7 @@  __osmv_sa_mad_rcv_cb(IN osm_madw_t * p_madw,
 					"__osmv_sa_mad_rcv_cb: Count = 0\n");
 			}
 			else {
-				query_res.result_cnt = (uintn_t)
+				query_res.result_cnt =
 					((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /
 					 ib_get_attr_size(p_sa_mad->attr_offset));
 				osm_log(p_bind->p_log, OSM_LOG_DEBUG,
diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c
index dc5e5f3..c813b58 100644
--- a/opensm/opensm/osm_mcast_tbl.c
+++ b/opensm/opensm/osm_mcast_tbl.c
@@ -115,9 +115,7 @@  void osm_mcast_tbl_destroy(IN osm_mcast_tbl_t * p_tbl)
 void osm_mcast_tbl_set(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho,
 		       IN uint8_t port)
 {
-	uintn_t mlid_offset;
-	uintn_t mask_offset;
-	uintn_t bit_mask;
+	unsigned mlid_offset, mask_offset, bit_mask;
 	int16_t block_num;
 
 	CL_ASSERT(p_tbl);
@@ -141,9 +139,7 @@  void osm_mcast_tbl_set(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho,
 boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,
 				IN uint16_t mlid_ho, IN uint8_t port_num)
 {
-	uintn_t mlid_offset;
-	uintn_t mask_offset;
-	uintn_t bit_mask;
+	unsigned mlid_offset, mask_offset, bit_mask;
 
 	CL_ASSERT(p_tbl);
 
@@ -170,7 +166,7 @@  boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,
 boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,
 				    IN uint16_t mlid_ho)
 {
-	uintn_t mlid_offset;
+	unsigned mlid_offset;
 	uint8_t position;
 	uint16_t result = 0;
 
@@ -227,7 +223,7 @@  ib_api_status_t osm_mcast_tbl_set_block(IN osm_mcast_tbl_t * p_tbl,
 void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)
 {
 	uint8_t i;
-	uintn_t mlid_offset;
+	unsigned mlid_offset;
 
 	CL_ASSERT(p_tbl);
 	CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO);
diff --git a/opensm/opensm/osm_sa_multipath_record.c b/opensm/opensm/osm_sa_multipath_record.c
index 6ea5ba0..bf28f8d 100644
--- a/opensm/opensm/osm_sa_multipath_record.c
+++ b/opensm/opensm/osm_sa_multipath_record.c
@@ -884,8 +884,7 @@  static uint32_t mpr_rcv_get_port_pair_paths(IN osm_sa_t * sa,
 	uint16_t dest_lid_ho;
 	uint32_t path_num = 0;
 	uint8_t preference;
-	uintn_t src_offset;
-	uintn_t dest_offset;
+	unsigned src_offset, dest_offset;
 
 	OSM_LOG_ENTER(sa->p_log);
 
@@ -1072,7 +1071,7 @@  static osm_mpr_item_t *mpr_rcv_get_apm_port_pair_paths(IN osm_sa_t * sa,
 	uint16_t dest_lid_max_ho;
 	uint16_t src_lid_ho;
 	uint16_t dest_lid_ho;
-	uintn_t iterations;
+	unsigned iterations;
 	int src_lids, dest_lids;
 
 	OSM_LOG_ENTER(sa->p_log);
diff --git a/opensm/opensm/osm_sa_path_record.c b/opensm/opensm/osm_sa_path_record.c
index b9c6055..149b225 100644
--- a/opensm/opensm/osm_sa_path_record.c
+++ b/opensm/opensm/osm_sa_path_record.c
@@ -910,9 +910,7 @@  static void pr_rcv_get_port_pair_paths(IN osm_sa_t * sa,
 	uint16_t dest_lid_ho;
 	uint32_t path_num;
 	uint8_t preference;
-	uintn_t iterations;
-	uintn_t src_offset;
-	uintn_t dest_offset;
+	unsigned iterations, src_offset, dest_offset;
 
 	OSM_LOG_ENTER(sa->p_log);
 
@@ -1026,7 +1024,7 @@  static void pr_rcv_get_port_pair_paths(IN osm_sa_t * sa,
 		if (comp_mask & IB_PR_COMPMASK_NUMBPATH)
 			iterations = ib_path_rec_num_path(p_pr);
 		else
-			iterations = (uintn_t) (-1);
+			iterations = (unsigned) (-1);
 	else
 		iterations = 1;