]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/BootMaintenanceManagerUiLib: rebase to ARRAY_SIZE()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 Oct 2016 17:00:44 +0000 (19:00 +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/BootMaintenanceManagerUiLib/BootMaintenance.c
MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c

index e2afe43abacdb325016fa73cfc5dc85d77cc81ac..f40c61a0fb909877ef8a070fdba9808685375bca 100644 (file)
@@ -548,16 +548,16 @@ UpdateTerminalContent (
     ASSERT (NewMenuEntry != NULL);\r
     NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;\r
     NewTerminalContext->BaudRateIndex = BmmData->COMBaudRate[Index];\r
-    ASSERT (BmmData->COMBaudRate[Index] < (sizeof (BaudRateList) / sizeof (BaudRateList[0])));\r
+    ASSERT (BmmData->COMBaudRate[Index] < (ARRAY_SIZE (BaudRateList)));\r
     NewTerminalContext->BaudRate      = BaudRateList[BmmData->COMBaudRate[Index]].Value;\r
     NewTerminalContext->DataBitsIndex = BmmData->COMDataRate[Index];\r
-    ASSERT (BmmData->COMDataRate[Index] < (sizeof (DataBitsList) / sizeof (DataBitsList[0])));\r
+    ASSERT (BmmData->COMDataRate[Index] < (ARRAY_SIZE (DataBitsList)));\r
     NewTerminalContext->DataBits      = (UINT8) DataBitsList[BmmData->COMDataRate[Index]].Value;\r
     NewTerminalContext->StopBitsIndex = BmmData->COMStopBits[Index];\r
-    ASSERT (BmmData->COMStopBits[Index] < (sizeof (StopBitsList) / sizeof (StopBitsList[0])));\r
+    ASSERT (BmmData->COMStopBits[Index] < (ARRAY_SIZE (StopBitsList)));\r
     NewTerminalContext->StopBits      = (UINT8) StopBitsList[BmmData->COMStopBits[Index]].Value;\r
     NewTerminalContext->ParityIndex   = BmmData->COMParity[Index];\r
-    ASSERT (BmmData->COMParity[Index] < (sizeof (ParityList) / sizeof (ParityList[0])));\r
+    ASSERT (BmmData->COMParity[Index] < (ARRAY_SIZE (ParityList)));\r
     NewTerminalContext->Parity        = (UINT8) ParityList[BmmData->COMParity[Index]].Value;\r
     NewTerminalContext->TerminalType  = BmmData->COMTerminalType[Index];\r
     NewTerminalContext->FlowControl   = BmmData->COMFlowControl[Index];\r
index fd48d5d4cdb085839109d9ab74afe983d23cc39a..a145a77c70a1149f50eda20d31e8f1bee3e6c454 100644 (file)
@@ -567,7 +567,7 @@ LocateSerialIo (
     Vendor.Header.Type                = MESSAGING_DEVICE_PATH;\r
     Vendor.Header.SubType             = MSG_VENDOR_DP;\r
 \r
-    for (Index2 = 0; Index2 < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])); Index2++) {\r
+    for (Index2 = 0; Index2 < (ARRAY_SIZE (TerminalTypeGuid)); Index2++) {\r
       CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));\r
       SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));\r
       NewDevicePath = AppendDevicePathNode (\r
@@ -1131,21 +1131,21 @@ GetTerminalAttribute (
         break;\r
       }\r
     }\r
-    for (AttributeIndex = 0; AttributeIndex < sizeof (DataBitsList) / sizeof (DataBitsList[0]); AttributeIndex++) {\r
+    for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (DataBitsList); AttributeIndex++) {\r
       if (NewTerminalContext->DataBits == (UINT64) (DataBitsList[AttributeIndex].Value)) {\r
         NewTerminalContext->DataBitsIndex = AttributeIndex;\r
         break;\r
       }\r
     }    \r
 \r
-    for (AttributeIndex = 0; AttributeIndex < sizeof (ParityList) / sizeof (ParityList[0]); AttributeIndex++) {\r
+    for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (ParityList); AttributeIndex++) {\r
       if (NewTerminalContext->Parity == (UINT64) (ParityList[AttributeIndex].Value)) {\r
         NewTerminalContext->ParityIndex = AttributeIndex;\r
         break;\r
       }\r
     }\r
 \r
-    for (AttributeIndex = 0; AttributeIndex < sizeof (StopBitsList) / sizeof (StopBitsList[0]); AttributeIndex++) {\r
+    for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (StopBitsList); AttributeIndex++) {\r
       if (NewTerminalContext->StopBits == (UINT64) (StopBitsList[AttributeIndex].Value)) {\r
         NewTerminalContext->StopBitsIndex = AttributeIndex;\r
         break;\r
index 8194979477ba148bd660202056b9ba45d9a5019c..dede4b392f153a0690be5323d8bcabdc2ae365b8 100644 (file)
@@ -736,7 +736,7 @@ UpdateConModePage (
     //\r
     UnicodeValueToString (ModeString, 0, Col, 0);\r
     PStr = &ModeString[0];\r
-    StrnCatS (PStr, sizeof (ModeString) / sizeof (ModeString[0]), L" x ", StrLen(L" x ") + 1);\r
+    StrnCatS (PStr, ARRAY_SIZE (ModeString), L" x ", StrLen(L" x ") + 1);\r
     PStr = PStr + StrLen (PStr);\r
     UnicodeValueToString (PStr , 0, Row, 0);\r
 \r
@@ -847,7 +847,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
   ASSERT (OptionsOpCodeHandle != NULL);\r
 \r
-  for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (DataBitsList); Index++) {\r
     CheckFlags = 0;\r
 \r
     if (DataBitsList[Index].Value == 8) {\r
@@ -880,7 +880,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
   ASSERT (OptionsOpCodeHandle != NULL);\r
 \r
-  for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (ParityList); Index++) {\r
     CheckFlags = 0;\r
     if (ParityList[Index].Value ==  NoParity) {\r
       CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
@@ -912,7 +912,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
   ASSERT (OptionsOpCodeHandle != NULL);\r
 \r
-  for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (StopBitsList); Index++) {\r
     CheckFlags = 0;\r
     if (StopBitsList[Index].Value == OneStopBit) {\r
       CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
@@ -944,7 +944,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
   ASSERT (OptionsOpCodeHandle != NULL);\r
 \r
-  for (Index = 0; Index < sizeof (TerminalType) / sizeof (TerminalType[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (TerminalType); Index++) {\r
     CheckFlags = 0;\r
     if (Index == 0) {\r
       CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
@@ -976,7 +976,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
   ASSERT (OptionsOpCodeHandle != NULL);\r
 \r
-  for (Index = 0; Index < sizeof (mFlowControlType) / sizeof (mFlowControlType[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mFlowControlType); Index++) {\r
   CheckFlags = 0;\r
     if (Index == 0) {\r
       CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
index a2ae2a7736667b8bc16458b5ca70bd599f953646..746b2335edc525f318c6299c578087be29d577ae 100644 (file)
@@ -371,7 +371,7 @@ Var_UpdateConsoleOption (
       Vendor.Header.Type    = MESSAGING_DEVICE_PATH;\r
       Vendor.Header.SubType = MSG_VENDOR_DP;\r
       \r
-      ASSERT (NewTerminalContext->TerminalType < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])));\r
+      ASSERT (NewTerminalContext->TerminalType < (ARRAY_SIZE (TerminalTypeGuid)));\r
       CopyMem (\r
         &Vendor.Guid,\r
         &TerminalTypeGuid[NewTerminalContext->TerminalType],\r