[ofa-general] Re: [PATCH] [TRIVIAL] opensm/osm_state_mgr.c: fixing soma data types and a corresponding log messages
Yevgeny Kliteynik
kliteyn at dev.mellanox.co.il
Sun Jun 29 23:45:38 PDT 2008
Sasha Khapyorsky wrote:
> Hi Yevgeny,
>
> On 09:41 Wed 25 Jun , Yevgeny Kliteynik wrote:
>> Fixing some data types and corresponding log messages,
>> thus solving compiler warnings.
>>
>> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
>> ---
>> opensm/opensm/osm_state_mgr.c | 9 +++++----
>> 1 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
>> index f15a4af..6ca276b 100644
>> --- a/opensm/opensm/osm_state_mgr.c
>> +++ b/opensm/opensm/osm_state_mgr.c
>> @@ -863,7 +863,8 @@ 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;
>> + size_t ref_size, curr_size;
>> + uint16_t max_lid, lid;
>
> Finally it stores ref_size or cur_size values in max_lid, so it can
> overflow. Could you be more specific about compiler warnings?
Sure:
/swgwork/kliteyn/git/management_master/opensm/opensm/osm_state_mgr.c: In function __osm_state_mgr_check_tbl_consistency:
/swgwork/kliteyn/git/management_master/opensm/opensm/osm_state_mgr.c:922: warning: format %u expects type unsigned int, but argument 5 has type size_t
/swgwork/kliteyn/git/management_master/opensm/opensm/osm_state_mgr.c:934: warning: format %u expects type unsigned int, but argument 8 has type size_t
/swgwork/kliteyn/git/management_master/opensm/opensm/osm_state_mgr.c:946: warning: format %u expects type unsigned int, but argument 5 has type size_t
Patch shortly.
-- Yevgeny
More information about the general
mailing list