diff options
author | Gary Lin <glin@suse.com> | 2016-10-27 18:16:15 +0800 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2016-10-27 18:21:06 +0200 |
commit | 5a5025e485b299c76ebed79fa63ba88a5b219a12 (patch) | |
tree | 98b46b4a3bce19139e37f8d84a488b6968bb1db7 /OvmfPkg/Csm | |
parent | 1399565a93a7457db262ae2cb81431062fcc30c4 (diff) | |
download | edk2-platforms-5a5025e485b299c76ebed79fa63ba88a5b219a12.tar.xz |
OvmfPkg: Make more use of ARRAY_SIZE()
Convert the remaining pieces to make the code shorter and more readable.
Cc: Justen Jordan <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: tweak subject line]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/Csm')
-rw-r--r-- | OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c index b929db04d9..8d5d2e58a9 100644 --- a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c +++ b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c @@ -130,18 +130,18 @@ LegacyRegionManipulationInternal ( // Loop to find the start PAM.
//
StartIndex = 0;
- for (Index = 0; Index < (sizeof(mSectionArray) / sizeof (mSectionArray[0])); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (mSectionArray); Index++) {
if ((Start >= mSectionArray[Index].Start) && (Start < (mSectionArray[Index].Start + mSectionArray[Index].Length))) {
StartIndex = Index;
break;
}
}
- ASSERT (Index < (sizeof(mSectionArray) / sizeof (mSectionArray[0])));
+ ASSERT (Index < ARRAY_SIZE (mSectionArray));
//
// Program PAM until end PAM is encountered
//
- for (Index = StartIndex; Index < (sizeof(mSectionArray) / sizeof (mSectionArray[0])); Index++) {
+ for (Index = StartIndex; Index < ARRAY_SIZE (mSectionArray); Index++) {
if (ReadEnable != NULL) {
if (*ReadEnable) {
PciOr8 (
@@ -177,7 +177,7 @@ LegacyRegionManipulationInternal ( break;
}
}
- ASSERT (Index < (sizeof(mSectionArray) / sizeof (mSectionArray[0])));
+ ASSERT (Index < ARRAY_SIZE (mSectionArray));
return EFI_SUCCESS;
}
|