diff mbox

[edk2,39/47] PerformancePkg/Dp_App: rebase to ARRAY_SIZE()

Message ID 20161026190504.9888-40-lersek@redhat.com
State Accepted
Commit fcfba04abd20f1d164022a361607a06083f5c6ee
Headers show

Commit Message

Laszlo Ersek Oct. 26, 2016, 7:04 p.m. UTC
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 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 mbox

Patch

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)  ||