From a031a53fa499f7be8a71d0c76134de6392495548 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 26 Oct 2016 19:02:52 +0200 Subject: MdeModulePkg/BootManagerUiLib: rebase to ARRAY_SIZE() Cc: Dandan Bi Cc: Eric Dong Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Feng Tian Reviewed-by: Star Zeng Reviewed-by: Jordan Justen --- MdeModulePkg/Library/BootManagerUiLib/BootManager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c index cab38ca280..bf872f867e 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c @@ -343,7 +343,7 @@ GroupMultipleLegacyBootOption4SameType ( // Legacy Boot Option // DEBUG ((EFI_D_ERROR, "[BootManagerDxe] ==== Find Legacy Boot Option 0x%x! ==== \n", Index)); - ASSERT ((((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF) < sizeof (DeviceTypeIndex) / sizeof (DeviceTypeIndex[0])); + ASSERT ((((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF) < ARRAY_SIZE (DeviceTypeIndex)); NextIndex = &DeviceTypeIndex[((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF]; if (*NextIndex == (UINTN) -1) { @@ -362,7 +362,7 @@ GroupMultipleLegacyBootOption4SameType ( // // Update the DeviceTypeIndex array to reflect the right shift operation // - for (DeviceIndex = 0; DeviceIndex < sizeof (DeviceTypeIndex) / sizeof (DeviceTypeIndex[0]); DeviceIndex++) { + for (DeviceIndex = 0; DeviceIndex < ARRAY_SIZE (DeviceTypeIndex); DeviceIndex++) { if (DeviceTypeIndex[DeviceIndex] != (UINTN) -1 && DeviceTypeIndex[DeviceIndex] >= *NextIndex) { DeviceTypeIndex[DeviceIndex]++; } @@ -526,7 +526,7 @@ UpdateBootManager ( HiiHandle, 0, mDeviceTypeStr[ - MIN (DeviceType & 0xF, sizeof (mDeviceTypeStr) / sizeof (mDeviceTypeStr[0]) - 1) + MIN (DeviceType & 0xF, ARRAY_SIZE (mDeviceTypeStr) - 1) ], NULL ); -- cgit v1.2.3