// Firstly get the default boot description\r
//\r
DefaultDescription = NULL;\r
- for (Index = 0; Index < sizeof (mBmBootDescriptionHandlers) / sizeof (mBmBootDescriptionHandlers[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (mBmBootDescriptionHandlers); Index++) {\r
DefaultDescription = mBmBootDescriptionHandlers[Index] (Handle);\r
if (DefaultDescription != NULL) {\r
//\r
EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;\r
EFI_DEVICE_PATH_PROTOCOL *TempNewDevicePath;\r
\r
- if (ConsoleType >= sizeof (mConVarName) / sizeof (mConVarName[0])) {\r
+ if (ConsoleType >= ARRAY_SIZE (mConVarName)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
\r
KeyShiftStateCount = 0;\r
BmGenerateKeyShiftState (0, KeyOption, EFI_SHIFT_STATE_VALID, KeyShiftStates, &KeyShiftStateCount);\r
- ASSERT (KeyShiftStateCount <= sizeof (KeyShiftStates) / sizeof (KeyShiftStates[0]));\r
+ ASSERT (KeyShiftStateCount <= ARRAY_SIZE (KeyShiftStates));\r
\r
EfiAcquireLock (&mBmHotkeyLock);\r
\r
return FALSE;\r
}\r
\r
- for (Index = 0; Index < sizeof (mBmLoadOptionName) / sizeof (mBmLoadOptionName[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (mBmLoadOptionName); Index++) {\r
if ((VariableNameLen - 4 == StrLen (mBmLoadOptionName[Index])) &&\r
(StrnCmp (VariableName, mBmLoadOptionName[Index], VariableNameLen - 4) == 0)\r
) {\r
}\r
}\r
\r
- if (Index == sizeof (mBmLoadOptionName) / sizeof (mBmLoadOptionName[0])) {\r
+ if (Index == ARRAY_SIZE (mBmLoadOptionName)) {\r
return FALSE;\r
}\r
\r