diff mbox

[edk2,13/47] EdkCompatibilityPkg/Sample/Tools: rebase to ARRAY_SIZE()

Message ID 20161026190504.9888-14-lersek@redhat.com
State Accepted
Commit bd79132f3e715b41ebc1732238b1497a6fab833a
Headers show

Commit Message

Laszlo Ersek Oct. 26, 2016, 7:04 p.m. UTC
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c    | 4 ++--
 EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.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/EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c b/EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c
index cf8efc86e1b4..f787ae81c2b3 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c
@@ -397,8 +397,8 @@  GetCodeTypeStr (
   UINT8     CodeType
   )
 {
-  if (CodeType >= sizeof (mCodeTypeStr) / sizeof (*mCodeTypeStr)) {
-    CodeType = sizeof (mCodeTypeStr) / sizeof (*mCodeTypeStr) - 1;
+  if (CodeType >= ARRAY_SIZE (mCodeTypeStr)) {
+    CodeType = ARRAY_SIZE (mCodeTypeStr) - 1;
   }
   return mCodeTypeStr[CodeType];
 }
diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.c b/EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.c
index e69af5c25932..e60a2d9eeb30 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.c
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.c
@@ -470,7 +470,7 @@  static const IFR_PARSE_TABLE_ENTRY  mIfrParseTable[] = {
     IfrParse2A
   },
 };
-#define PARSE_TABLE_ENTRIES (sizeof (mIfrParseTable) / sizeof (mIfrParseTable[0]))
+#define PARSE_TABLE_ENTRIES (ARRAY_SIZE (mIfrParseTable))
 
 static
 STATUS