summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-10-26 19:00:44 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-10-27 11:10:56 +0200
commit6eeeb2882637f081bf4e44bdbfb599f4f3b1ba84 (patch)
tree1a5e29da9143de30432125c8b1bf3a480b37b2c7 /MdeModulePkg
parent8368951f1bc7f7b45ad991340aeeac1f345ff013 (diff)
downloadedk2-6eeeb2882637f081bf4e44bdbfb599f4f3b1ba84.tar.gz
edk2-6eeeb2882637f081bf4e44bdbfb599f4f3b1ba84.tar.bz2
edk2-6eeeb2882637f081bf4e44bdbfb599f4f3b1ba84.zip
MdeModulePkg/BootMaintenanceManagerUiLib: rebase to ARRAY_SIZE()
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c8
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c8
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c12
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c2
4 files changed, 15 insertions, 15 deletions
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
index e2afe43aba..f40c61a0fb 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
@@ -548,16 +548,16 @@ UpdateTerminalContent (
ASSERT (NewMenuEntry != NULL);
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
NewTerminalContext->BaudRateIndex = BmmData->COMBaudRate[Index];
- ASSERT (BmmData->COMBaudRate[Index] < (sizeof (BaudRateList) / sizeof (BaudRateList[0])));
+ ASSERT (BmmData->COMBaudRate[Index] < (ARRAY_SIZE (BaudRateList)));
NewTerminalContext->BaudRate = BaudRateList[BmmData->COMBaudRate[Index]].Value;
NewTerminalContext->DataBitsIndex = BmmData->COMDataRate[Index];
- ASSERT (BmmData->COMDataRate[Index] < (sizeof (DataBitsList) / sizeof (DataBitsList[0])));
+ ASSERT (BmmData->COMDataRate[Index] < (ARRAY_SIZE (DataBitsList)));
NewTerminalContext->DataBits = (UINT8) DataBitsList[BmmData->COMDataRate[Index]].Value;
NewTerminalContext->StopBitsIndex = BmmData->COMStopBits[Index];
- ASSERT (BmmData->COMStopBits[Index] < (sizeof (StopBitsList) / sizeof (StopBitsList[0])));
+ ASSERT (BmmData->COMStopBits[Index] < (ARRAY_SIZE (StopBitsList)));
NewTerminalContext->StopBits = (UINT8) StopBitsList[BmmData->COMStopBits[Index]].Value;
NewTerminalContext->ParityIndex = BmmData->COMParity[Index];
- ASSERT (BmmData->COMParity[Index] < (sizeof (ParityList) / sizeof (ParityList[0])));
+ ASSERT (BmmData->COMParity[Index] < (ARRAY_SIZE (ParityList)));
NewTerminalContext->Parity = (UINT8) ParityList[BmmData->COMParity[Index]].Value;
NewTerminalContext->TerminalType = BmmData->COMTerminalType[Index];
NewTerminalContext->FlowControl = BmmData->COMFlowControl[Index];
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
index fd48d5d4cd..a145a77c70 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
@@ -567,7 +567,7 @@ LocateSerialIo (
Vendor.Header.Type = MESSAGING_DEVICE_PATH;
Vendor.Header.SubType = MSG_VENDOR_DP;
- for (Index2 = 0; Index2 < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])); Index2++) {
+ for (Index2 = 0; Index2 < (ARRAY_SIZE (TerminalTypeGuid)); Index2++) {
CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));
SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
NewDevicePath = AppendDevicePathNode (
@@ -1131,21 +1131,21 @@ GetTerminalAttribute (
break;
}
}
- for (AttributeIndex = 0; AttributeIndex < sizeof (DataBitsList) / sizeof (DataBitsList[0]); AttributeIndex++) {
+ for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (DataBitsList); AttributeIndex++) {
if (NewTerminalContext->DataBits == (UINT64) (DataBitsList[AttributeIndex].Value)) {
NewTerminalContext->DataBitsIndex = AttributeIndex;
break;
}
}
- for (AttributeIndex = 0; AttributeIndex < sizeof (ParityList) / sizeof (ParityList[0]); AttributeIndex++) {
+ for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (ParityList); AttributeIndex++) {
if (NewTerminalContext->Parity == (UINT64) (ParityList[AttributeIndex].Value)) {
NewTerminalContext->ParityIndex = AttributeIndex;
break;
}
}
- for (AttributeIndex = 0; AttributeIndex < sizeof (StopBitsList) / sizeof (StopBitsList[0]); AttributeIndex++) {
+ for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (StopBitsList); AttributeIndex++) {
if (NewTerminalContext->StopBits == (UINT64) (StopBitsList[AttributeIndex].Value)) {
NewTerminalContext->StopBitsIndex = AttributeIndex;
break;
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
index 8194979477..dede4b392f 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
@@ -736,7 +736,7 @@ UpdateConModePage (
//
UnicodeValueToString (ModeString, 0, Col, 0);
PStr = &ModeString[0];
- StrnCatS (PStr, sizeof (ModeString) / sizeof (ModeString[0]), L" x ", StrLen(L" x ") + 1);
+ StrnCatS (PStr, ARRAY_SIZE (ModeString), L" x ", StrLen(L" x ") + 1);
PStr = PStr + StrLen (PStr);
UnicodeValueToString (PStr , 0, Row, 0);
@@ -847,7 +847,7 @@ UpdateTerminalPage (
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
- for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (DataBitsList); Index++) {
CheckFlags = 0;
if (DataBitsList[Index].Value == 8) {
@@ -880,7 +880,7 @@ UpdateTerminalPage (
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
- for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (ParityList); Index++) {
CheckFlags = 0;
if (ParityList[Index].Value == NoParity) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
@@ -912,7 +912,7 @@ UpdateTerminalPage (
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
- for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (StopBitsList); Index++) {
CheckFlags = 0;
if (StopBitsList[Index].Value == OneStopBit) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
@@ -944,7 +944,7 @@ UpdateTerminalPage (
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
- for (Index = 0; Index < sizeof (TerminalType) / sizeof (TerminalType[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (TerminalType); Index++) {
CheckFlags = 0;
if (Index == 0) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
@@ -976,7 +976,7 @@ UpdateTerminalPage (
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
- for (Index = 0; Index < sizeof (mFlowControlType) / sizeof (mFlowControlType[0]); Index++) {
+ for (Index = 0; Index < ARRAY_SIZE (mFlowControlType); Index++) {
CheckFlags = 0;
if (Index == 0) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
index a2ae2a7736..746b2335ed 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
@@ -371,7 +371,7 @@ Var_UpdateConsoleOption (
Vendor.Header.Type = MESSAGING_DEVICE_PATH;
Vendor.Header.SubType = MSG_VENDOR_DP;
- ASSERT (NewTerminalContext->TerminalType < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])));
+ ASSERT (NewTerminalContext->TerminalType < (ARRAY_SIZE (TerminalTypeGuid)));
CopyMem (
&Vendor.Guid,
&TerminalTypeGuid[NewTerminalContext->TerminalType],