diff mbox

[edk2,29/47] MdeModulePkg/DisplayEngineDxe: rebase to ARRAY_SIZE()

Message ID 20161026190504.9888-30-lersek@redhat.com
State Accepted
Commit bce1d8a888c0998f9015629d5faa06058dfe49dd
Headers show

Commit Message

Laszlo Ersek Oct. 26, 2016, 7:04 p.m. UTC
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
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/Universal/DisplayEngineDxe/FormDisplay.c  | 4 ++--
 MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c | 6 +++---
 2 files changed, 5 insertions(+), 5 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/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index 8531d0ee06c6..b37c1cc2e4aa 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -49,7 +49,7 @@  SCAN_CODE_TO_SCREEN_OPERATION     gScanCodeToOperation[] = {
   }
 };
 
-UINTN mScanCodeNumber = sizeof (gScanCodeToOperation) / sizeof (gScanCodeToOperation[0]);
+UINTN mScanCodeNumber = ARRAY_SIZE (gScanCodeToOperation);
 
 SCREEN_OPERATION_T0_CONTROL_FLAG  gScreenOperationToControlFlag[] = {
   {
@@ -3248,7 +3248,7 @@  UiDisplayMenu (
       }
 
       for (Index = 0;
-           Index < sizeof (gScreenOperationToControlFlag) / sizeof (gScreenOperationToControlFlag[0]);
+           Index < ARRAY_SIZE (gScreenOperationToControlFlag);
            Index++
           ) {
         if (ScreenOperation == gScreenOperationToControlFlag[Index].ScreenOperation) {
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
index 8e7b735c7063..400b93427caa 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
@@ -1070,14 +1070,14 @@  EnterCarriageReturn:
 
           if (ValidateFail) {
             UpdateStatusBar (INPUT_ERROR, TRUE);
-            ASSERT (Count < sizeof (PreviousNumber) / sizeof (PreviousNumber[0]));
+            ASSERT (Count < ARRAY_SIZE (PreviousNumber));
             EditValue = PreviousNumber[Count];
             break;
           }
         } else {
           if (EditValue > Maximum) {
             UpdateStatusBar (INPUT_ERROR, TRUE);
-            ASSERT (Count < sizeof (PreviousNumber) / sizeof (PreviousNumber[0]));
+            ASSERT (Count < ARRAY_SIZE (PreviousNumber));
             EditValue = PreviousNumber[Count];
             break;
           }
@@ -1086,7 +1086,7 @@  EnterCarriageReturn:
         UpdateStatusBar (INPUT_ERROR, FALSE);
 
         Count++;
-        ASSERT (Count < (sizeof (PreviousNumber) / sizeof (PreviousNumber[0])));
+        ASSERT (Count < (ARRAY_SIZE (PreviousNumber)));
         PreviousNumber[Count] = EditValue;
 
         gST->ConOut->SetAttribute (gST->ConOut, GetHighlightTextColor ());