From patchwork Mon Oct 12 21:36:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 53227 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 n9CM4Ect031270 for ; Mon, 12 Oct 2009 22:04:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933216AbZJLVep (ORCPT ); Mon, 12 Oct 2009 17:34:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933213AbZJLVep (ORCPT ); Mon, 12 Oct 2009 17:34:45 -0400 Received: from mail-bw0-f210.google.com ([209.85.218.210]:41525 "EHLO mail-bw0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933216AbZJLVen (ORCPT ); Mon, 12 Oct 2009 17:34:43 -0400 Received: by mail-bw0-f210.google.com with SMTP id 6so3454882bwz.37 for ; Mon, 12 Oct 2009 14:34:32 -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=u93KrKUIR7nNc1xnCdIUGS8/2skmGA0DmRUj19kqHFU=; b=tvU6NncVlmeUnPk/xqLlZjks5B97N9kX3V4jku65rAd+NtFHToS5C68vTsshsBWg0M 7RmW/1rP35iKfukExp78cxXV+te1vQgd9DUnIg/xLtnYX1rGe8kRRN6PVprp7U32gfKQ DMG0NaeUOF+QG0G7wqswZgy53mSu4tSzIhuJA= 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=s4jUMrCTUBr9TJCuTNZiJZ7ZiiKugojgEPhqJOgcdqhtNPHKGivQsXsWSpGD1OgaQK SdNZq9M1d1TTVksjfm9sQgi3N9Ywpf57juy1xtpKnh7Y9iekGC6mEwB3QT8la9lydskz c5z5z4rlLM2rT7bKXq+Qtde4l+7zroCsCiuN4= Received: by 10.102.226.14 with SMTP id y14mr2668101mug.76.1255383272281; Mon, 12 Oct 2009 14:34:32 -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 y37sm805177mug.4.2009.10.12.14.34.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Oct 2009 14:34:31 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 0A04912563; Mon, 12 Oct 2009 23:36:31 +0200 (IST) Date: Mon, 12 Oct 2009 23:36:31 +0200 From: Sasha Khapyorsky To: linux-rdma Cc: "Stan C. Smith" Subject: [PATCH] osmtest: initialize attr_array[] on declaration Message-ID: <20091012213631.GF13830@me> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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/osmtest/main.c b/opensm/osmtest/main.c index 11bb0c8..4cead91 100644 --- a/opensm/osmtest/main.c +++ b/opensm/osmtest/main.c @@ -213,14 +213,9 @@ static void print_all_guids(IN osmtest_t * p_osmt) { ib_api_status_t status; uint32_t num_ports = MAX_LOCAL_IBPORTS; - ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS]; + ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS] = { {0} }; uint32_t i; - for (i = 0; i < num_ports; i++) { - attr_array[i].num_pkeys = 0; - attr_array[i].p_pkey_table = NULL; - } - /* Call the transport layer for a list of local port GUID values. @@ -246,14 +241,9 @@ ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t port_guid) { ib_api_status_t status; uint32_t num_ports = MAX_LOCAL_IBPORTS; - ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS]; + ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS] = { {0} }; uint32_t i; - for (i = 0; i < num_ports; i++) { - attr_array[i].num_pkeys = 0; - attr_array[i].p_pkey_table = NULL; - } - /* Call the transport layer for a list of local port GUID values. diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c index a1457b8..9dd1117 100644 --- a/opensm/osmtest/osmtest.c +++ b/opensm/osmtest/osmtest.c @@ -7236,16 +7236,10 @@ osmtest_bind(IN osmtest_t * p_osmt, uint32_t port_index; ib_api_status_t status; uint32_t num_ports = MAX_LOCAL_IBPORTS; - ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS]; - uint32_t i; + ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS] = { {0} }; OSM_LOG_ENTER(&p_osmt->log); - for (i = 0; i < num_ports; i++) { - attr_array[i].num_pkeys = 0; - attr_array[i].p_pkey_table = NULL; - } - /* * Call the transport layer for a list of local port * GUID values.