***SPAM*** Re: ***SPAM*** Re: [ofa-general] Re: [PATCH] Add pkey table support to osm_get_all_port_attrs

Hal Rosenstock hal.rosenstock at gmail.com
Fri Feb 27 03:33:18 PST 2009


Sasha,

On Thu, Feb 26, 2009 at 7:03 AM, Hal Rosenstock
<hal.rosenstock at gmail.com> wrote:

[snip...]

>>> diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
>>> index 73a6274..503d7fa 100644
>>> --- a/opensm/opensm/main.c
>>> +++ b/opensm/opensm/main.c
>>> @@ -2,6 +2,7 @@
>>>   * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
>>>   * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.
>>>   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
>>> + * Copyright (c) 2009 HNR Consulting. All rights reserved.
>>>   *
>>>   * This software is available to you under a choice of one of two
>>>   * licenses.  You may choose to be licensed under the terms of the GNU
>>> @@ -364,6 +365,11 @@ static ib_net64_t get_port_guid(IN osm_opensm_t * p_osm, uint64_t port_guid)
>>>       uint32_t i, choice = 0;
>>>       ib_api_status_t status;
>>>
>>> +     for (i = 0; i < num_ports; i++) {
>>> +             attr_array[i].num_pkeys = 0;
>>> +             attr_array[i].p_pkey_table = NULL;
>>> +     }
>>> +
>>
>> Here and below. Just
>>
>>        memset(attr_array, 0, sizeof(attr_array));
>>
>> would be enough.
>
> Sure; next version.

The thought above is that it is more efficient to just initialize the
needed fields rather than the entire array which is not required.

-- Hal



More information about the general mailing list