From patchwork Wed Oct 26 19:04:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 79514 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp227329qge; Wed, 26 Oct 2016 12:06:45 -0700 (PDT) X-Received: by 10.98.206.1 with SMTP id y1mr6888389pfg.70.1477508805752; Wed, 26 Oct 2016 12:06:45 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id wm3si3483230pab.75.2016.10.26.12.06.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 12:06:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B44B71A1E86; Wed, 26 Oct 2016 12:06:03 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7B5631A1F2B for ; Wed, 26 Oct 2016 12:06:02 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 134F661B9A; Wed, 26 Oct 2016 19:06:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QJ5705025834; Wed, 26 Oct 2016 15:06:00 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 26 Oct 2016 21:04:46 +0200 Message-Id: <20161026190504.9888-30-lersek@redhat.com> In-Reply-To: <20161026190504.9888-1-lersek@redhat.com> References: <20161026190504.9888-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 26 Oct 2016 19:06:02 +0000 (UTC) Subject: [edk2] [PATCH 29/47] MdeModulePkg/DisplayEngineDxe: rebase to ARRAY_SIZE() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dandan Bi , Feng Tian , Eric Dong , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Cc: Dandan Bi Cc: Eric Dong Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- 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 --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 ());