[ofa-general] Re: [PATCH v2] [TRIVIAL] opensm/osm_state_mgr.c: fixing some data types

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Jun 30 01:52:33 PDT 2008


Sasha Khapyorsky wrote:
> On 09:49 Mon 30 Jun     , Yevgeny Kliteynik wrote:
>> Fixing some data types and solving compiler warnings
>> in the corresponding log messages.
>>
>> Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
>> ---
>>  opensm/opensm/osm_state_mgr.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
>> index 9a8409b..734df79 100644
>> --- a/opensm/opensm/osm_state_mgr.c
>> +++ b/opensm/opensm/osm_state_mgr.c
>> @@ -862,7 +862,7 @@ static void __osm_state_mgr_check_tbl_consistency(IN osm_sm_t * sm)
>>  	osm_port_t *p_port;
>>  	osm_port_t *p_next_port;
>>  	cl_ptr_vector_t *p_port_lid_tbl;
>> -	size_t max_lid, ref_size, curr_size, lid;
>> +	uint16_t max_lid, ref_size, curr_size, lid;
> 
> Those values are used for storing result of cl_ptr_vector_get_size()
> which has size_t type.

cl_ptr_vector_get_size() returns uint32_t, and the value is lid,
which means that the vector can't be longer than uint16_t.

> I think the proper solution for this is to use
> '%zu' format in OSM_LOG().

OK, patch shortly.

-- Yevgeny

> Sasha
> 




More information about the general mailing list