From patchwork Wed Oct 26 19:04:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 79524 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp227773qge; Wed, 26 Oct 2016 12:07:34 -0700 (PDT) X-Received: by 10.98.129.130 with SMTP id t124mr6842533pfd.5.1477508854210; Wed, 26 Oct 2016 12:07:34 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id k21si4149384pgj.268.2016.10.26.12.07.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 12:07:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8F0C41A1F43; Wed, 26 Oct 2016 12:06:19 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1E42E1A1F41 for ; Wed, 26 Oct 2016 12:06:16 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2DF78F26E; Wed, 26 Oct 2016 19:06:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QJ570F025834; Wed, 26 Oct 2016 15:06:14 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 26 Oct 2016 21:04:56 +0200 Message-Id: <20161026190504.9888-40-lersek@redhat.com> In-Reply-To: <20161026190504.9888-1-lersek@redhat.com> References: <20161026190504.9888-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 26 Oct 2016 19:06:15 +0000 (UTC) Subject: [edk2] [PATCH 39/47] PerformancePkg/Dp_App: rebase to ARRAY_SIZE() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Daryl McDaniel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Cc: Daryl McDaniel Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- PerformancePkg/Dp_App/Dp.c | 2 +- PerformancePkg/Dp_App/DpTrace.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c index 6890a99c2937..26a3ebcd1d07 100644 --- a/PerformancePkg/Dp_App/Dp.c +++ b/PerformancePkg/Dp_App/Dp.c @@ -114,7 +114,7 @@ InitialShellParamList( void ) // // Allocate one more for the end tag. // - ListLength = sizeof (ParamList) / sizeof (ParamList[0]) + 1; + ListLength = ARRAY_SIZE (ParamList) + 1; DpParamList = AllocatePool (sizeof (SHELL_PARAM_ITEM) * ListLength); ASSERT (DpParamList != NULL); diff --git a/PerformancePkg/Dp_App/DpTrace.c b/PerformancePkg/Dp_App/DpTrace.c index 256f7462838c..6a62bba7efe0 100644 --- a/PerformancePkg/Dp_App/DpTrace.c +++ b/PerformancePkg/Dp_App/DpTrace.c @@ -220,8 +220,8 @@ DumpAllTrace( ++Count; // Count the number of records printed // If Handle is non-zero, see if we can determine a name for the driver - AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); // Use Module by default + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); if (Measurement.Handle != NULL) { // See if the Handle is in the HandleBuffer for (TIndex = 0; TIndex < HandleCount; TIndex++) { @@ -594,7 +594,7 @@ ProcessHandles( continue; } mGaugeString[0] = 0; // Empty driver name by default - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); // See if the Handle is in the HandleBuffer for (Index = 0; Index < HandleCount; Index++) { if (Measurement.Handle == HandleBuffer[Index]) { @@ -777,8 +777,8 @@ ProcessGlobal( &Measurement.EndTimeStamp, &Measurement.Identifier)) != 0) { - AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); mGaugeString[25] = 0; mUnicodeToken[31] = 0; if ( ! ( IsPhase( &Measurement) ||