]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Core/PiSmmCore: rebase to ARRAY_SIZE()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 Oct 2016 16:58:17 +0000 (18:58 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 27 Oct 2016 09:10:56 +0000 (11:10 +0200)
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
MdeModulePkg/Core/PiSmmCore/Pool.c
MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c

index 9d447025883d2a0728efee15fa682531a4724f58..02dab01425607c73d227d0d784fac33fa151beae 100644 (file)
@@ -42,7 +42,7 @@ SmmInitializeMemoryServices (
   //\r
   // Initialize Pool list\r
   //\r
-  for (Index = sizeof (mSmmPoolLists) / sizeof (*mSmmPoolLists); Index > 0;) {\r
+  for (Index = ARRAY_SIZE (mSmmPoolLists); Index > 0;) {\r
     InitializeListHead (&mSmmPoolLists[--Index]);\r
   }\r
   CurrentSmramRangesIndex = 0;\r
index 93585f199df9a5ca67d05258ef805fdce01c3069..d983cefbb3dc18b97db0084a3c8981717efa41f3 100644 (file)
@@ -2670,7 +2670,7 @@ ProfileMemoryTypeToStr (
   )\r
 {\r
   UINTN     Index;\r
-  for (Index = 0; Index < sizeof (mMemoryTypeString) / sizeof (mMemoryTypeString[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mMemoryTypeString); Index++) {\r
     if (mMemoryTypeString[Index].MemoryType == MemoryType) {\r
       return mMemoryTypeString[Index].MemoryTypeStr;\r
     }\r
@@ -2697,12 +2697,12 @@ ProfileActionToStr (
   CHAR8     **ActionString;\r
 \r
   ActionString = mSmmActionString;\r
-  ActionStringCount = sizeof (mSmmActionString) / sizeof (mSmmActionString[0]);\r
+  ActionStringCount = ARRAY_SIZE (mSmmActionString);\r
 \r
   if ((UINTN) (UINT32) Action < ActionStringCount) {\r
     return ActionString[Action];\r
   }\r
-  for (Index = 0; Index < sizeof (mExtActionString) / sizeof (mExtActionString[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mExtActionString); Index++) {\r
     if (mExtActionString[Index].Action == Action) {\r
       return mExtActionString[Index].String;\r
     }\r