]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/BootManagerUiLib: rebase to ARRAY_SIZE()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 Oct 2016 17:02:52 +0000 (19:02 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 27 Oct 2016 09:10:56 +0000 (11:10 +0200)
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>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
MdeModulePkg/Library/BootManagerUiLib/BootManager.c

index cab38ca28087c1a79feea91233e5db753e8543a1..bf872f867e0800bcfee8ad925e53ea9a1c2eeb2d 100644 (file)
@@ -343,7 +343,7 @@ GroupMultipleLegacyBootOption4SameType (
       // Legacy Boot Option\r
       //\r
       DEBUG ((EFI_D_ERROR, "[BootManagerDxe] ==== Find Legacy Boot Option  0x%x! ==== \n", Index));\r
-      ASSERT ((((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF) < sizeof (DeviceTypeIndex) / sizeof (DeviceTypeIndex[0]));\r
+      ASSERT ((((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF) < ARRAY_SIZE (DeviceTypeIndex));\r
       NextIndex = &DeviceTypeIndex[((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF];\r
 \r
       if (*NextIndex == (UINTN) -1) {\r
@@ -362,7 +362,7 @@ GroupMultipleLegacyBootOption4SameType (
         //\r
         // Update the DeviceTypeIndex array to reflect the right shift operation\r
         //\r
-        for (DeviceIndex = 0; DeviceIndex < sizeof (DeviceTypeIndex) / sizeof (DeviceTypeIndex[0]); DeviceIndex++) {\r
+        for (DeviceIndex = 0; DeviceIndex < ARRAY_SIZE (DeviceTypeIndex); DeviceIndex++) {\r
           if (DeviceTypeIndex[DeviceIndex] != (UINTN) -1 && DeviceTypeIndex[DeviceIndex] >= *NextIndex) {\r
             DeviceTypeIndex[DeviceIndex]++;\r
           }\r
@@ -526,7 +526,7 @@ UpdateBootManager (
                      HiiHandle,\r
                      0,\r
                      mDeviceTypeStr[\r
-                       MIN (DeviceType & 0xF, sizeof (mDeviceTypeStr) / sizeof (mDeviceTypeStr[0]) - 1)\r
+                       MIN (DeviceType & 0xF, ARRAY_SIZE (mDeviceTypeStr) - 1)\r
                        ],\r
                      NULL\r
                      );\r