summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-10-26 18:58:17 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-10-27 11:10:56 +0200
commit8368951f1bc7f7b45ad991340aeeac1f345ff013 (patch)
tree9bbd93f18fd16af7094ea5edfb0e0f10b2600816 /MdeModulePkg
parented998e06a43e140b562542d3b9099bf21326f8d7 (diff)
downloadedk2-8368951f1bc7f7b45ad991340aeeac1f345ff013.tar.gz
edk2-8368951f1bc7f7b45ad991340aeeac1f345ff013.tar.bz2
edk2-8368951f1bc7f7b45ad991340aeeac1f345ff013.zip
MdeModulePkg/Core/PiSmmCore: rebase to ARRAY_SIZE()
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/PiSmmCore/Pool.c2
-rw-r--r--MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c
index 9d44702588..02dab01425 100644
--- a/MdeModulePkg/Core/PiSmmCore/Pool.c
+++ b/MdeModulePkg/Core/PiSmmCore/Pool.c
@@ -42,7 +42,7 @@ SmmInitializeMemoryServices (
//
// Initialize Pool list
//
- for (Index = sizeof (mSmmPoolLists) / sizeof (*mSmmPoolLists); Index > 0;) {
+ for (Index = ARRAY_SIZE (mSmmPoolLists); Index > 0;) {
InitializeListHead (&mSmmPoolLists[--Index]);
}
CurrentSmramRangesIndex = 0;
diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
index 93585f199d..d983cefbb3 100644
--- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
+++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
@@ -2670,7 +2670,7 @@ ProfileMemoryTypeToStr (
)
{
UINTN Index;
- for (Index = 0; Index < sizeof (mMemoryTypeString) / sizeof (mMemoryTypeString[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (mMemoryTypeString); Index++) {
if (mMemoryTypeString[Index].MemoryType == MemoryType) {
return mMemoryTypeString[Index].MemoryTypeStr;
}
@@ -2697,12 +2697,12 @@ ProfileActionToStr (
CHAR8 **ActionString;
ActionString = mSmmActionString;
- ActionStringCount = sizeof (mSmmActionString) / sizeof (mSmmActionString[0]);
+ ActionStringCount = ARRAY_SIZE (mSmmActionString);
if ((UINTN) (UINT32) Action < ActionStringCount) {
return ActionString[Action];
}
- for (Index = 0; Index < sizeof (mExtActionString) / sizeof (mExtActionString[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (mExtActionString); Index++) {
if (mExtActionString[Index].Action == Action) {
return mExtActionString[Index].String;
}