public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] osm_subnet.c
@ 2009-10-01 21:35 Smith, Stan
  2009-10-04  0:13 ` Sasha Khapyorsky
  0 siblings, 1 reply; 10+ messages in thread
From: Smith, Stan @ 2009-10-01 21:35 UTC (permalink / raw)
  To: Sasha Khapyorsky
  Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org, linux-rdma


Set function return type to match that of cl_pfn_fmap_cmp_t to align with how the function is invoked.

Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

--- a/opensm/opensm/osm_subnet.c        2009-10-01 12:45:52.000000000 -0700
+++ b/opensm/opensm/osm_subnet.c        2009-10-01 14:24:18.000000000 -0700
@@ -397,7 +397,7 @@

 /**********************************************************************
  **********************************************************************/
-static long compar_mgids(const void *m1, const void *m2)
+static intn_t compar_mgids(const void *m1, const void *m2)
 {
        return memcmp(m1, m2, sizeof(ib_gid_t));
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osm_subnet.c
  2009-10-01 21:35 [PATCH] osm_subnet.c Smith, Stan
@ 2009-10-04  0:13 ` Sasha Khapyorsky
  2009-10-05 16:09   ` Smith, Stan
  2009-10-05 16:20   ` Sean Hefty
  0 siblings, 2 replies; 10+ messages in thread
From: Sasha Khapyorsky @ 2009-10-04  0:13 UTC (permalink / raw)
  To: Smith, Stan; +Cc: ofw@lists.openfabrics.org, linux-rdma

Hi Stan,

On 14:35 Thu 01 Oct     , Smith, Stan wrote:
> 
> Set function return type to match that of cl_pfn_fmap_cmp_t to align with how the function is invoked.
> 
> Signed-off-by: stan smith <stan.smith@intel.com>
> 
> --- a/opensm/opensm/osm_subnet.c        2009-10-01 12:45:52.000000000 -0700
> +++ b/opensm/opensm/osm_subnet.c        2009-10-01 14:24:18.000000000 -0700
> @@ -397,7 +397,7 @@
> 
>  /**********************************************************************
>   **********************************************************************/
> -static long compar_mgids(const void *m1, const void *m2)
> +static intn_t compar_mgids(const void *m1, const void *m2)

Any disagreement about changing a prototype of this method
(cl_pfn_fmap_cmp_t) in complib to use standard type (long) instead of
"homemade" and less clear one ('intn_t')?

Sasha

>  {
>         return memcmp(m1, m2, sizeof(ib_gid_t));
>  }
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] osm_subnet.c
  2009-10-04  0:13 ` Sasha Khapyorsky
@ 2009-10-05 16:09   ` Smith, Stan
       [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8783C0D-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2009-10-05 16:20   ` Sean Hefty
  1 sibling, 1 reply; 10+ messages in thread
From: Smith, Stan @ 2009-10-05 16:09 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: ofw@lists.openfabrics.org, linux-rdma

Sasha Khapyorsky wrote:
> Hi Stan,
>
> On 14:35 Thu 01 Oct     , Smith, Stan wrote:
>>
>> Set function return type to match that of cl_pfn_fmap_cmp_t to align
>> with how the function is invoked.
>>
>> Signed-off-by: stan smith <stan.smith@intel.com>
>>
>> --- a/opensm/opensm/osm_subnet.c        2009-10-01
>> 12:45:52.000000000 -0700 +++ b/opensm/opensm/osm_subnet.c
>> 2009-10-01 14:24:18.000000000 -0700 @@ -397,7 +397,7 @@
>>
>>  /**********************************************************************
>>
>> **********************************************************************/
>> -static long compar_mgids(const void *m1, const void *m2) +static
>> intn_t compar_mgids(const void *m1, const void *m2)
>
> Any disagreement about changing a prototype of this method
> (cl_pfn_fmap_cmp_t) in complib to use standard type (long) instead of
> "homemade" and less clear one ('intn_t')?
>
> Sasha
>
>>  {
>>         return memcmp(m1, m2, sizeof(ib_gid_t));
>>  }

How is the processor architecture 'natural' size intn_t less clear than 'long'?
In some worlds sizeof(long) != sizeof(void*).

I would prefer leaving the definition as intn_t as that's the way it has been defined for 'years' (think application code not necessarily OFED) which is coded to the intn_t definition.
In the Windows world, cl_fleximap.h is not just an OpenSM utilized file, more like something that would live in /usr/include.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Re: [PATCH] osm_subnet.c
  2009-10-04  0:13 ` Sasha Khapyorsky
  2009-10-05 16:09   ` Smith, Stan
@ 2009-10-05 16:20   ` Sean Hefty
  2009-11-12 19:18     ` Sasha Khapyorsky
  1 sibling, 1 reply; 10+ messages in thread
From: Sean Hefty @ 2009-10-05 16:20 UTC (permalink / raw)
  To: 'Sasha Khapyorsky', Smith, Stan; +Cc: ofw, linux-rdma

>>  /**********************************************************************
>>   **********************************************************************/
>> -static long compar_mgids(const void *m1, const void *m2)
>> +static intn_t compar_mgids(const void *m1, const void *m2)
>
>Any disagreement about changing a prototype of this method
>(cl_pfn_fmap_cmp_t) in complib to use standard type (long) instead of
>"homemade" and less clear one ('intn_t')?
>
>Sasha
>
>>  {
>>         return memcmp(m1, m2, sizeof(ib_gid_t));
>>  }

If the function is simply a wrapper around a single call to memcmp, why keep it
at all?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Re: [PATCH] osm_subnet.c
  2009-10-05 16:20   ` Sean Hefty
@ 2009-11-12 19:18     ` Sasha Khapyorsky
  2009-11-12 19:23       ` [ofw] " Sean Hefty
  0 siblings, 1 reply; 10+ messages in thread
From: Sasha Khapyorsky @ 2009-11-12 19:18 UTC (permalink / raw)
  To: Sean Hefty; +Cc: ofw, linux-rdma

On 09:20 Mon 05 Oct     , Sean Hefty wrote:
> >>  /**********************************************************************
> >>   **********************************************************************/
> >> -static long compar_mgids(const void *m1, const void *m2)
> >> +static intn_t compar_mgids(const void *m1, const void *m2)
> >
> >Any disagreement about changing a prototype of this method
> >(cl_pfn_fmap_cmp_t) in complib to use standard type (long) instead of
> >"homemade" and less clear one ('intn_t')?
> >
> >Sasha
> >
> >>  {
> >>         return memcmp(m1, m2, sizeof(ib_gid_t));
> >>  }
> 
> If the function is simply a wrapper around a single call to memcmp, why keep it
> at all?

The function is used as comparator callback in complib's fleximap
implementation (just similar to qsort()'s compar parameter and others)
and signed integer (= , >  or < 0) should be returned. Using pointer
sized int as return value is not needed here. We can do it to match
others comparators (qsort, scandir, etc.) prototype exactly:

	int compar(const void *, const void *);

, or to not bother at all and leave it as 'long'.

Hmm, I would prefer to change to 'int' to prevent future confusing.
Thoughts?

Sasha

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [ofw] Re: [PATCH] osm_subnet.c
  2009-11-12 19:18     ` Sasha Khapyorsky
@ 2009-11-12 19:23       ` Sean Hefty
       [not found]         ` <81D21ED9D6F34BC1B7DA64F50EE5A7DD-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Sean Hefty @ 2009-11-12 19:23 UTC (permalink / raw)
  To: 'Sasha Khapyorsky'
  Cc: Smith, Stan, ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5, linux-rdma

>	int compar(const void *, const void *);
>
>, or to not bother at all and leave it as 'long'.
>
>Hmm, I would prefer to change to 'int' to prevent future confusing.
>Thoughts?

int seems to make the most sense to me.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osm_subnet.c
       [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8783C0D-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2009-11-12 19:35       ` Sasha Khapyorsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sasha Khapyorsky @ 2009-11-12 19:35 UTC (permalink / raw)
  To: Smith, Stan
  Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org, linux-rdma

On 09:09 Mon 05 Oct     , Smith, Stan wrote:
> >>
> >> --- a/opensm/opensm/osm_subnet.c        2009-10-01
> >> 12:45:52.000000000 -0700 +++ b/opensm/opensm/osm_subnet.c
> >> 2009-10-01 14:24:18.000000000 -0700 @@ -397,7 +397,7 @@
> >>
> >>  /**********************************************************************
> >>
> >> **********************************************************************/
> >> -static long compar_mgids(const void *m1, const void *m2) +static
> >> intn_t compar_mgids(const void *m1, const void *m2)
> >
> > Any disagreement about changing a prototype of this method
> > (cl_pfn_fmap_cmp_t) in complib to use standard type (long) instead of
> > "homemade" and less clear one ('intn_t')?
> >
> > Sasha
> >
> >>  {
> >>         return memcmp(m1, m2, sizeof(ib_gid_t));
> >>  }
> 
> How is the processor architecture 'natural' size intn_t less clear than 'long'?

'intn_t' is not a standard type, but a hack defined in complib, unlike
this 'long' is a very basic C language type (btw I'm fine with 'int' for
this particular case).

> In some worlds sizeof(long) != sizeof(void*).

This is bad. Fortunately for this case we don't need a "natural" int. And
for case where it is really needed a standard types would be more
appropriate in general than complib's defined intn_t.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] opensm: cleanup intn_t uses
       [not found]         ` <81D21ED9D6F34BC1B7DA64F50EE5A7DD-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-11-12 20:21           ` Sasha Khapyorsky
  2009-11-12 20:22           ` [PATCH] complib/fleximap: make compar callback to return int Sasha Khapyorsky
  1 sibling, 0 replies; 10+ messages in thread
From: Sasha Khapyorsky @ 2009-11-12 20:21 UTC (permalink / raw)
  To: linux-rdma; +Cc: Sean Hefty, Smith, Stan, Hal Rosenstock


In all cases where non standard (defined in complib) intn_t and uintn_t
types were used pointer boundary was not required. So clean it up -
replace by int and unsigned int types.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/include/opensm/osm_mcast_tbl.h   |    2 +-
 opensm/libvendor/osm_vendor_al.c        |    4 ++--
 opensm/libvendor/osm_vendor_ibumad_sa.c |    6 +++---
 opensm/libvendor/osm_vendor_mlx_sa.c    |    6 +++---
 opensm/opensm/osm_mcast_tbl.c           |   14 +++++---------
 opensm/opensm/osm_sa_multipath_record.c |    5 ++---
 opensm/opensm/osm_sa_path_record.c      |    6 ++----
 7 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/opensm/include/opensm/osm_mcast_tbl.h b/opensm/include/opensm/osm_mcast_tbl.h
index 0745b5b..37e2c26 100644
--- a/opensm/include/opensm/osm_mcast_tbl.h
+++ b/opensm/include/opensm/osm_mcast_tbl.h
@@ -174,7 +174,7 @@ void osm_mcast_tbl_delete(IN osm_mcast_tbl_t ** pp_tbl);
 *
 * SYNOPSIS
 */
-int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset);
+int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN unsigned mlid_offset);
 /*
 * PARAMETERS
 *
diff --git a/opensm/libvendor/osm_vendor_al.c b/opensm/libvendor/osm_vendor_al.c
index abf3395..3ac05c9 100644
--- a/opensm/libvendor/osm_vendor_al.c
+++ b/opensm/libvendor/osm_vendor_al.c
@@ -489,7 +489,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 * const p_num_guids)
 {
 	ib_api_status_t status;
 
@@ -581,7 +581,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 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 1a7d5a2..e05a5ef 100644
--- a/opensm/libvendor/osm_vendor_ibumad_sa.c
+++ b/opensm/libvendor/osm_vendor_ibumad_sa.c
@@ -129,9 +129,9 @@ __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)
-				    ((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /
-				     ib_get_attr_size(p_sa_mad->attr_offset));
+				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,
 					"Count = %u = %zu / %u (%zu)\n",
 					query_res.result_cnt,
diff --git a/opensm/libvendor/osm_vendor_mlx_sa.c b/opensm/libvendor/osm_vendor_mlx_sa.c
index 0a4e050..e47f072 100644
--- a/opensm/libvendor/osm_vendor_mlx_sa.c
+++ b/opensm/libvendor/osm_vendor_mlx_sa.c
@@ -141,9 +141,9 @@ __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)
-					((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /
-					 ib_get_attr_size(p_sa_mad->attr_offset));
+				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,
 					"__osmv_sa_mad_rcv_cb: "
 					"Count = %u = %zu / %u (%zu)\n",
diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c
index 14f8e7a..ee59275 100644
--- a/opensm/opensm/osm_mcast_tbl.c
+++ b/opensm/opensm/osm_mcast_tbl.c
@@ -88,9 +88,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 && p_tbl->p_mask_tbl);
@@ -108,7 +106,7 @@ void osm_mcast_tbl_set(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho,
 		p_tbl->max_block_in_use = (uint16_t) block_num;
 }
 
-int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset)
+int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN unsigned mlid_offset)
 {
 	size_t mft_depth, size;
 	uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX + 1];
@@ -144,9 +142,7 @@ done:
 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);
 
@@ -171,7 +167,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;
 
@@ -223,7 +219,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)
 {
-	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 ca3d967..0658480 100644
--- a/opensm/opensm/osm_sa_multipath_record.c
+++ b/opensm/opensm/osm_sa_multipath_record.c
@@ -872,8 +872,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);
 
@@ -1058,7 +1057,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 457b40c..62a2a8b 100644
--- a/opensm/opensm/osm_sa_path_record.c
+++ b/opensm/opensm/osm_sa_path_record.c
@@ -898,9 +898,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);
 
@@ -1015,7 +1013,7 @@ static void pr_rcv_get_port_pair_paths(IN osm_sa_t * sa,
 	else if (comp_mask & IB_PR_COMPMASK_NUMBPATH)
 		iterations = ib_path_rec_num_path(p_pr);
 	else
-		iterations = (uintn_t) (-1);
+		iterations = (unsigned) (-1);
 
 	while (path_num < iterations) {
 		/*
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] complib/fleximap: make compar callback to return int
       [not found]         ` <81D21ED9D6F34BC1B7DA64F50EE5A7DD-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  2009-11-12 20:21           ` [PATCH] opensm: cleanup intn_t uses Sasha Khapyorsky
@ 2009-11-12 20:22           ` Sasha Khapyorsky
  2009-11-13 16:06             ` [PATCH] complib: replace intn_t types by C99 intptr_t Sasha Khapyorsky
  1 sibling, 1 reply; 10+ messages in thread
From: Sasha Khapyorsky @ 2009-11-12 20:22 UTC (permalink / raw)
  To: linux-rdma; +Cc: Sean Hefty, Smith, Stan, ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5


To be consistent with another similar comparator functions (used in
qsort, scandir, etc.) make fleximap comparator function to return 'int'
instead of 'long'.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/complib/cl_map.c              |    8 ++++----
 opensm/include/complib/cl_fleximap.h |    2 +-
 opensm/opensm/osm_subnet.c           |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/opensm/complib/cl_map.c b/opensm/complib/cl_map.c
index b49b4b8..d851bf8 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;
+	int 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;
+	int 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;
+	int 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;
+	int cmp;
 
 	CL_ASSERT(p_map1);
 	CL_ASSERT(p_map2);
diff --git a/opensm/include/complib/cl_fleximap.h b/opensm/include/complib/cl_fleximap.h
index 0af8766..ec008cf 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 int
     (*cl_pfn_fmap_cmp_t) (IN const void *const p_key1,
 			  IN const void *const p_key2);
 /*
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index cac5e94..dd72a3a 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -397,7 +397,7 @@ static const opt_rec_t opt_tbl[] = {
 	{0}
 };
 
-static long compar_mgids(const void *m1, const void *m2)
+static int compar_mgids(const void *m1, const void *m2)
 {
 	return memcmp(m1, m2, sizeof(ib_gid_t));
 }
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] complib: replace intn_t types by C99 intptr_t
  2009-11-12 20:22           ` [PATCH] complib/fleximap: make compar callback to return int Sasha Khapyorsky
@ 2009-11-13 16:06             ` Sasha Khapyorsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sasha Khapyorsky @ 2009-11-13 16:06 UTC (permalink / raw)
  To: linux-rdma; +Cc: Sean Hefty, Smith, Stan, ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5


Use C99 standard pointer size integer types intptr_t and uintptr_t
instead of privately defined intn_t and uintn_t.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/complib/cl_pool.c              |    2 +-
 opensm/include/complib/cl_types.h     |   12 ++----------
 opensm/include/complib/cl_types_osd.h |    5 +----
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/opensm/complib/cl_pool.c b/opensm/complib/cl_pool.c
index 1f66284..5a8d637 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(uintptr_t));
 	}
 
 	p_pool->max_objects = max_size ? max_size : ~(size_t) 0;
diff --git a/opensm/include/complib/cl_types.h b/opensm/include/complib/cl_types.h
index 84f629d..2891c6b 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
+*	uintptr_t
 *	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) ((uintptr_t) &((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;
 
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-11-13 16:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 21:35 [PATCH] osm_subnet.c Smith, Stan
2009-10-04  0:13 ` Sasha Khapyorsky
2009-10-05 16:09   ` Smith, Stan
     [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8783C0D-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-11-12 19:35       ` Sasha Khapyorsky
2009-10-05 16:20   ` Sean Hefty
2009-11-12 19:18     ` Sasha Khapyorsky
2009-11-12 19:23       ` [ofw] " Sean Hefty
     [not found]         ` <81D21ED9D6F34BC1B7DA64F50EE5A7DD-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-11-12 20:21           ` [PATCH] opensm: cleanup intn_t uses Sasha Khapyorsky
2009-11-12 20:22           ` [PATCH] complib/fleximap: make compar callback to return int Sasha Khapyorsky
2009-11-13 16:06             ` [PATCH] complib: replace intn_t types by C99 intptr_t Sasha Khapyorsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox