diff mbox

[edk2,26/47] MdeModulePkg/VarCheckHiiLib: rebase to ARRAY_SIZE()

Message ID 20161026190504.9888-27-lersek@redhat.com
State Accepted
Commit fe69b398700860e718baa01eb4c76c338ea5f9e1
Headers show

Commit Message

Laszlo Ersek Oct. 26, 2016, 7:04 p.m. UTC
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c          | 4 ++--
 MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c | 2 +-
 2 files changed, 3 insertions(+), 3 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/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
index cab92967aa9a..dc1f88a07cce 100644
--- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
+++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
@@ -57,7 +57,7 @@  IfrOpCodeToStr (
   )
 {
   UINTN  Index;
-  for (Index = 0; Index < sizeof (mIfrOpCodeStringTable) / sizeof (mIfrOpCodeStringTable[0]); Index++) {
+  for (Index = 0; Index < ARRAY_SIZE (mIfrOpCodeStringTable); Index++) {
     if (mIfrOpCodeStringTable[Index].HiiOpCode == IfrOpCode) {
       return mIfrOpCodeStringTable[Index].HiiOpCodeStr;
     }
@@ -96,7 +96,7 @@  HiiPackageTypeToStr (
   )
 {
   UINTN     Index;
-  for (Index = 0; Index < sizeof (mPackageTypeStringTable) / sizeof (mPackageTypeStringTable[0]); Index++) {
+  for (Index = 0; Index < ARRAY_SIZE (mPackageTypeStringTable); Index++) {
     if (mPackageTypeStringTable[Index].PackageType == PackageType) {
       return mPackageTypeStringTable[Index].PackageTypeStr;
     }
diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c
index 3afa7962aa61..b9ca9084915b 100644
--- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c
+++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c
@@ -318,7 +318,7 @@  HiiOpCodeToStr (
   )
 {
   UINTN     Index;
-  for (Index = 0; Index < sizeof (mHiiOpCodeStringTable) / sizeof (mHiiOpCodeStringTable[0]); Index++) {
+  for (Index = 0; Index < ARRAY_SIZE (mHiiOpCodeStringTable); Index++) {
     if (mHiiOpCodeStringTable[Index].HiiOpCode == HiiOpCode) {
       return mHiiOpCodeStringTable[Index].HiiOpCodeStr;
     }