From patchwork Sun Oct 4 11:01:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 51583 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n94Axi4E017826 for ; Sun, 4 Oct 2009 10:59:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752394AbZJDK7y (ORCPT ); Sun, 4 Oct 2009 06:59:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753037AbZJDK7y (ORCPT ); Sun, 4 Oct 2009 06:59:54 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:43746 "EHLO mail-ew0-f211.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752394AbZJDK7w (ORCPT ); Sun, 4 Oct 2009 06:59:52 -0400 Received: by ewy7 with SMTP id 7so2677665ewy.17 for ; Sun, 04 Oct 2009 03:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=9HD7eQhrBbBtYT/FK+nMovHsP9ZV1q4/eKQUxv3zfDI=; b=kee6XGZ4bRKJaIxL4XkIGUNaXEwkhRqWnyQjIjOYIRWd1UMbkbUvZQpMikP/zw4AIe Vmx1ys8t8uyetWTrbZdW5w2UVLv5lu4MEArAxj43Z6Io7VsXJhxNHkMSsx+hYhyFuCwi QPd3SsRpoHvNP5MPCcydB5Qt3DtWKpgDoQfKo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=GWrk4X+wa0EEGh0O7nVqVu//x1MJh+eRvHw5i76mzKMYWX2dxZl45QeyY+Fhg9/k8h LeWmDmuKzkf+ysMsO8m0WFR4LnkLH48gIUV9UqG58iCjdF5jqBvxHk0sZoD/o0pyJmXe yKChw73136j8osh1ASMxw7eXmbCq/MWVUras4= Received: by 10.211.132.20 with SMTP id j20mr5548891ebn.32.1254653954768; Sun, 04 Oct 2009 03:59:14 -0700 (PDT) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 5sm2041660eyh.8.2009.10.04.03.59.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 04 Oct 2009 03:59:14 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 9B4645C16A; Sun, 4 Oct 2009 13:01:04 +0200 (IST) Date: Sun, 4 Oct 2009 13:01:04 +0200 From: Sasha Khapyorsky To: linux-rdma Cc: "Smith, Stan" Subject: [PATCH] opensm: kill intn_t and uintn_t types Message-ID: <20091004110104.GP17846@me> References: <3F6F638B8D880340AB536D29CD4C1E1912C86E8A8F@orsmsx501.amr.corp.intel.com> <20091004001316.GK17846@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091004001316.GK17846@me> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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;