]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmConsole.c
index bdbb9a8770697b1ad52421835b01f46831bd4da6..60e7b1099afe0f0affca7d2e1b9cd1c01218a3bb 100644 (file)
@@ -9,7 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 \r
 #include "InternalBm.h"\r
 \r
-CHAR16       *mConVarName[] = {\r
+CHAR16  *mConVarName[] = {\r
   L"ConIn",\r
   L"ConOut",\r
   L"ErrOut",\r
@@ -28,16 +28,16 @@ BmGetVideoController (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                Status;\r
-  UINTN                     RootBridgeHandleCount;\r
-  EFI_HANDLE                *RootBridgeHandleBuffer;\r
-  UINTN                     HandleCount;\r
-  EFI_HANDLE                *HandleBuffer;\r
-  UINTN                     RootBridgeIndex;\r
-  UINTN                     Index;\r
-  EFI_HANDLE                VideoController;\r
-  EFI_PCI_IO_PROTOCOL       *PciIo;\r
-  PCI_TYPE00                Pci;\r
+  EFI_STATUS           Status;\r
+  UINTN                RootBridgeHandleCount;\r
+  EFI_HANDLE           *RootBridgeHandleBuffer;\r
+  UINTN                HandleCount;\r
+  EFI_HANDLE           *HandleBuffer;\r
+  UINTN                RootBridgeIndex;\r
+  UINTN                Index;\r
+  EFI_HANDLE           VideoController;\r
+  EFI_PCI_IO_PROTOCOL  *PciIo;\r
+  PCI_TYPE00           Pci;\r
 \r
   //\r
   // Make all the PCI_IO protocols show up\r
@@ -72,18 +72,18 @@ BmGetVideoController (
     }\r
 \r
     for (Index = 0; Index < HandleCount; Index++) {\r
-      Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID **) &PciIo);\r
+      Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo);\r
       if (!EFI_ERROR (Status)) {\r
         //\r
         // Check for all video controller\r
         //\r
         Status = PciIo->Pci.Read (\r
-                          PciIo,\r
-                          EfiPciIoWidthUint32,\r
-                          0,\r
-                          sizeof (Pci) / sizeof (UINT32),\r
-                          &Pci\r
-                          );\r
+                              PciIo,\r
+                              EfiPciIoWidthUint32,\r
+                              0,\r
+                              sizeof (Pci) / sizeof (UINT32),\r
+                              &Pci\r
+                              );\r
         if (!EFI_ERROR (Status) && IS_PCI_VGA (&Pci)) {\r
           // TODO: use IS_PCI_DISPLAY??\r
           VideoController = HandleBuffer[Index];\r
@@ -91,12 +91,14 @@ BmGetVideoController (
         }\r
       }\r
     }\r
+\r
     FreePool (HandleBuffer);\r
 \r
     if (VideoController != NULL) {\r
       break;\r
     }\r
   }\r
+\r
   FreePool (RootBridgeHandleBuffer);\r
 \r
   return VideoController;\r
@@ -113,7 +115,7 @@ BmGetVideoController (
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 EfiBootManagerGetGopDevicePath (\r
-  IN  EFI_HANDLE                       VideoController\r
+  IN  EFI_HANDLE  VideoController\r
   )\r
 {\r
   UINTN                                Index;\r
@@ -130,7 +132,6 @@ EfiBootManagerGetGopDevicePath (
   EFI_DEVICE_PATH_PROTOCOL             *GopPool;\r
   EFI_DEVICE_PATH_PROTOCOL             *ReturnDevicePath;\r
 \r
-\r
   Status = gBS->ProtocolsPerHandle (\r
                   VideoController,\r
                   &ProtocolBuffer,\r
@@ -161,7 +162,7 @@ EfiBootManagerGetGopDevicePath (
         Status = gBS->OpenProtocol (\r
                         OpenInfoBuffer[Index].ControllerHandle,\r
                         &gEfiDevicePathProtocolGuid,\r
-                        (VOID **) &DevicePath,\r
+                        (VOID **)&DevicePath,\r
                         NULL,\r
                         NULL,\r
                         EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
@@ -174,9 +175,10 @@ EfiBootManagerGetGopDevicePath (
         for (Next = DevicePath; !IsDevicePathEnd (Next); Next = NextDevicePathNode (Next)) {\r
           Previous = Next;\r
         }\r
+\r
         ASSERT (Previous != NULL);\r
 \r
-        if (DevicePathType (Previous) == ACPI_DEVICE_PATH && DevicePathSubType (Previous) == ACPI_ADR_DP) {\r
+        if ((DevicePathType (Previous) == ACPI_DEVICE_PATH) && (DevicePathSubType (Previous) == ACPI_ADR_DP)) {\r
           Status = gBS->OpenProtocol (\r
                           OpenInfoBuffer[Index].ControllerHandle,\r
                           &gEfiGraphicsOutputProtocolGuid,\r
@@ -190,19 +192,19 @@ EfiBootManagerGetGopDevicePath (
             // Append the device path to GOP pool when there is GOP protocol installed.\r
             //\r
             TempDevicePath = GopPool;\r
-            GopPool = AppendDevicePathInstance (GopPool, DevicePath);\r
+            GopPool        = AppendDevicePathInstance (GopPool, DevicePath);\r
             gBS->FreePool (TempDevicePath);\r
           }\r
         }\r
 \r
-        if (DevicePathType (Previous) == HARDWARE_DEVICE_PATH && DevicePathSubType (Previous) == HW_CONTROLLER_DP) {\r
+        if ((DevicePathType (Previous) == HARDWARE_DEVICE_PATH) && (DevicePathSubType (Previous) == HW_CONTROLLER_DP)) {\r
           //\r
           // Recursively look for GOP child in this frame buffer handle\r
           //\r
           DEBUG ((DEBUG_INFO, "[Bds] Looking for GOP child deeper ... \n"));\r
-          TempDevicePath = GopPool;\r
+          TempDevicePath   = GopPool;\r
           ReturnDevicePath = EfiBootManagerGetGopDevicePath (OpenInfoBuffer[Index].ControllerHandle);\r
-          GopPool = AppendDevicePathInstance (GopPool, ReturnDevicePath);\r
+          GopPool          = AppendDevicePathInstance (GopPool, ReturnDevicePath);\r
           gBS->FreePool (ReturnDevicePath);\r
           gBS->FreePool (TempDevicePath);\r
         }\r
@@ -228,10 +230,10 @@ EfiBootManagerGetGopDevicePath (
 EFI_STATUS\r
 EFIAPI\r
 EfiBootManagerConnectVideoController (\r
-  EFI_HANDLE                 VideoController  OPTIONAL\r
+  EFI_HANDLE  VideoController  OPTIONAL\r
   )\r
 {\r
-  EFI_DEVICE_PATH_PROTOCOL   *Gop;\r
+  EFI_DEVICE_PATH_PROTOCOL  *Gop;\r
 \r
   if (VideoController == NULL) {\r
     //\r
@@ -285,21 +287,21 @@ EfiBootManagerConnectVideoController (
 **/\r
 BOOLEAN\r
 BmUpdateSystemTableConsole (\r
-  IN     CHAR16                   *VarName,\r
-  IN     EFI_GUID                 *ConsoleGuid,\r
-  IN OUT EFI_HANDLE               *ConsoleHandle,\r
-  IN OUT VOID                     **ProtocolInterface\r
+  IN     CHAR16      *VarName,\r
+  IN     EFI_GUID    *ConsoleGuid,\r
+  IN OUT EFI_HANDLE  *ConsoleHandle,\r
+  IN OUT VOID        **ProtocolInterface\r
   )\r
 {\r
-  EFI_STATUS                      Status;\r
-  UINTN                           DevicePathSize;\r
-  EFI_DEVICE_PATH_PROTOCOL        *FullDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL        *VarConsole;\r
-  EFI_DEVICE_PATH_PROTOCOL        *Instance;\r
-  EFI_DEVICE_PATH_PROTOCOL        *FullInstance;\r
-  VOID                            *Interface;\r
-  EFI_HANDLE                      NewHandle;\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;\r
+  EFI_STATUS                       Status;\r
+  UINTN                            DevicePathSize;\r
+  EFI_DEVICE_PATH_PROTOCOL         *FullDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL         *VarConsole;\r
+  EFI_DEVICE_PATH_PROTOCOL         *Instance;\r
+  EFI_DEVICE_PATH_PROTOCOL         *FullInstance;\r
+  VOID                             *Interface;\r
+  EFI_HANDLE                       NewHandle;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;\r
 \r
   ASSERT (VarName != NULL);\r
   ASSERT (ConsoleHandle != NULL);\r
@@ -308,11 +310,11 @@ BmUpdateSystemTableConsole (
 \r
   if (*ConsoleHandle != NULL) {\r
     Status = gBS->HandleProtocol (\r
-                   *ConsoleHandle,\r
-                   ConsoleGuid,\r
-                   &Interface\r
-                   );\r
-    if (Status == EFI_SUCCESS && Interface == *ProtocolInterface) {\r
+                    *ConsoleHandle,\r
+                    ConsoleGuid,\r
+                    &Interface\r
+                    );\r
+    if ((Status == EFI_SUCCESS) && (Interface == *ProtocolInterface)) {\r
       //\r
       // If ConsoleHandle is valid and console protocol on this handle also\r
       // also matched, just return.\r
@@ -324,7 +326,7 @@ BmUpdateSystemTableConsole (
   //\r
   // Get all possible consoles device path from EFI variable\r
   //\r
-  GetEfiGlobalVariable2 (VarName, (VOID **) &VarConsole, NULL);\r
+  GetEfiGlobalVariable2 (VarName, (VOID **)&VarConsole, NULL);\r
   if (VarConsole == NULL) {\r
     //\r
     // If there is no any console device, just return.\r
@@ -338,7 +340,7 @@ BmUpdateSystemTableConsole (
     //\r
     // Check every instance of the console variable\r
     //\r
-    Instance  = GetNextDevicePathInstance (&VarConsole, &DevicePathSize);\r
+    Instance = GetNextDevicePathInstance (&VarConsole, &DevicePathSize);\r
     if (Instance == NULL) {\r
       DEBUG ((DEBUG_ERROR, "[Bds] No valid console instance is found for %s!\n", VarName));\r
       // We should not ASSERT when all the console devices are removed.\r
@@ -351,11 +353,11 @@ BmUpdateSystemTableConsole (
     // Find console device handle by device path instance\r
     //\r
     FullInstance = Instance;\r
-    Status = gBS->LocateDevicePath (\r
-                    ConsoleGuid,\r
-                    &Instance,\r
-                    &NewHandle\r
-                    );\r
+    Status       = gBS->LocateDevicePath (\r
+                          ConsoleGuid,\r
+                          &Instance,\r
+                          &NewHandle\r
+                          );\r
     FreePool (FullInstance);\r
     if (!EFI_ERROR (Status)) {\r
       //\r
@@ -376,16 +378,16 @@ BmUpdateSystemTableConsole (
           //\r
           // If it is console out device, set console mode 80x25 if current mode is invalid.\r
           //\r
-          TextOut = (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *) Interface;\r
+          TextOut = (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)Interface;\r
           if (TextOut->Mode->Mode == -1) {\r
             TextOut->SetMode (TextOut, 0);\r
           }\r
         }\r
+\r
         FreePool (FullDevicePath);\r
         return TRUE;\r
       }\r
     }\r
-\r
   } while (Instance != NULL);\r
 \r
   //\r
@@ -435,10 +437,11 @@ EfiBootManagerUpdateConsoleVariable (
   if (CustomizedConDevicePath == ExclusiveDevicePath) {\r
     return EFI_UNSUPPORTED;\r
   }\r
+\r
   //\r
   // Delete the ExclusiveDevicePath from current default console\r
   //\r
-  GetEfiGlobalVariable2 (mConVarName[ConsoleType], (VOID **) &VarConsole, NULL);\r
+  GetEfiGlobalVariable2 (mConVarName[ConsoleType], (VOID **)&VarConsole, NULL);\r
   //\r
   // Initialize NewDevicePath\r
   //\r
@@ -448,9 +451,10 @@ EfiBootManagerUpdateConsoleVariable (
   // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.\r
   // In the end, NewDevicePath is the final device path.\r
   //\r
-  if (ExclusiveDevicePath != NULL && VarConsole != NULL) {\r
-      NewDevicePath = BmDelPartMatchInstance (VarConsole, ExclusiveDevicePath);\r
+  if ((ExclusiveDevicePath != NULL) && (VarConsole != NULL)) {\r
+    NewDevicePath = BmDelPartMatchInstance (VarConsole, ExclusiveDevicePath);\r
   }\r
+\r
   //\r
   // Try to append customized device path to NewDevicePath.\r
   //\r
@@ -465,9 +469,9 @@ EfiBootManagerUpdateConsoleVariable (
       // just append current customized device path\r
       //\r
       TempNewDevicePath = NewDevicePath;\r
-      NewDevicePath = AppendDevicePathInstance (NewDevicePath, CustomizedConDevicePath);\r
+      NewDevicePath     = AppendDevicePathInstance (NewDevicePath, CustomizedConDevicePath);\r
       if (TempNewDevicePath != NULL) {\r
-        FreePool(TempNewDevicePath);\r
+        FreePool (TempNewDevicePath);\r
       }\r
     }\r
   }\r
@@ -479,28 +483,28 @@ EfiBootManagerUpdateConsoleVariable (
                   mConVarName[ConsoleType],\r
                   &gEfiGlobalVariableGuid,\r
                   EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS\r
-                                                  | ((ConsoleType < ConInDev) ? EFI_VARIABLE_NON_VOLATILE : 0),\r
+                  | ((ConsoleType < ConInDev) ? EFI_VARIABLE_NON_VOLATILE : 0),\r
                   GetDevicePathSize (NewDevicePath),\r
                   NewDevicePath\r
                   );\r
 \r
   if (VarConsole == NewDevicePath) {\r
     if (VarConsole != NULL) {\r
-      FreePool(VarConsole);\r
+      FreePool (VarConsole);\r
     }\r
   } else {\r
     if (VarConsole != NULL) {\r
-      FreePool(VarConsole);\r
+      FreePool (VarConsole);\r
     }\r
+\r
     if (NewDevicePath != NULL) {\r
-      FreePool(NewDevicePath);\r
+      FreePool (NewDevicePath);\r
     }\r
   }\r
 \r
   return Status;\r
 }\r
 \r
-\r
 /**\r
   Connect the console device base on the variable ConsoleType.\r
 \r
@@ -515,7 +519,7 @@ EfiBootManagerUpdateConsoleVariable (
 EFI_STATUS\r
 EFIAPI\r
 EfiBootManagerConnectConsoleVariable (\r
-  IN  CONSOLE_TYPE              ConsoleType\r
+  IN  CONSOLE_TYPE  ConsoleType\r
   )\r
 {\r
   EFI_STATUS                Status;\r
@@ -538,7 +542,7 @@ EfiBootManagerConnectConsoleVariable (
   //\r
   // Check if the console variable exist\r
   //\r
-  GetEfiGlobalVariable2 (mConVarName[ConsoleType], (VOID **) &StartDevicePath, NULL);\r
+  GetEfiGlobalVariable2 (mConVarName[ConsoleType], (VOID **)&StartDevicePath, NULL);\r
   if (StartDevicePath == NULL) {\r
     return EFI_UNSUPPORTED;\r
   }\r
@@ -548,13 +552,13 @@ EfiBootManagerConnectConsoleVariable (
     //\r
     // Check every instance of the console variable\r
     //\r
-    Instance  = GetNextDevicePathInstance (&CopyOfDevicePath, &Size);\r
+    Instance = GetNextDevicePathInstance (&CopyOfDevicePath, &Size);\r
     if (Instance == NULL) {\r
       FreePool (StartDevicePath);\r
       return EFI_UNSUPPORTED;\r
     }\r
 \r
-    Next      = Instance;\r
+    Next = Instance;\r
     while (!IsDevicePathEndType (Next)) {\r
       Next = NextDevicePathNode (Next);\r
     }\r
@@ -568,23 +572,26 @@ EfiBootManagerConnectConsoleVariable (
     //\r
     if ((DevicePathType (Instance) == MESSAGING_DEVICE_PATH) &&\r
         ((DevicePathSubType (Instance) == MSG_USB_CLASS_DP) || (DevicePathSubType (Instance) == MSG_USB_WWID_DP))\r
-       ) {\r
+        )\r
+    {\r
       Status = BmConnectUsbShortFormDevicePath (Instance);\r
       if (!EFI_ERROR (Status)) {\r
         DeviceExist = TRUE;\r
       }\r
     } else {\r
       for (Next = Instance; !IsDevicePathEnd (Next); Next = NextDevicePathNode (Next)) {\r
-        if (DevicePathType (Next) == ACPI_DEVICE_PATH && DevicePathSubType (Next) == ACPI_ADR_DP) {\r
+        if ((DevicePathType (Next) == ACPI_DEVICE_PATH) && (DevicePathSubType (Next) == ACPI_ADR_DP)) {\r
           break;\r
-        } else if (DevicePathType (Next) == HARDWARE_DEVICE_PATH &&\r
-                   DevicePathSubType (Next) == HW_CONTROLLER_DP &&\r
-                   DevicePathType (NextDevicePathNode (Next)) == ACPI_DEVICE_PATH &&\r
-                   DevicePathSubType (NextDevicePathNode (Next)) == ACPI_ADR_DP\r
-                   ) {\r
+        } else if ((DevicePathType (Next) == HARDWARE_DEVICE_PATH) &&\r
+                   (DevicePathSubType (Next) == HW_CONTROLLER_DP) &&\r
+                   (DevicePathType (NextDevicePathNode (Next)) == ACPI_DEVICE_PATH) &&\r
+                   (DevicePathSubType (NextDevicePathNode (Next)) == ACPI_ADR_DP)\r
+                   )\r
+        {\r
           break;\r
         }\r
       }\r
+\r
       if (!IsDevicePathEnd (Next)) {\r
         //\r
         // For GOP device path, start the video driver with NULL remaining device path\r
@@ -597,6 +604,7 @@ EfiBootManagerConnectConsoleVariable (
       } else {\r
         Status = EfiBootManagerConnectDevicePath (Instance, NULL);\r
       }\r
+\r
       if (EFI_ERROR (Status)) {\r
         //\r
         // Delete the instance from the console varialbe\r
@@ -606,7 +614,8 @@ EfiBootManagerConnectConsoleVariable (
         DeviceExist = TRUE;\r
       }\r
     }\r
-    FreePool(Instance);\r
+\r
+    FreePool (Instance);\r
   } while (CopyOfDevicePath != NULL);\r
 \r
   FreePool (StartDevicePath);\r
@@ -618,7 +627,6 @@ EfiBootManagerConnectConsoleVariable (
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
 /**\r
   This function will search every input/output device in current system,\r
   and make every input/output device as potential console device.\r
@@ -643,46 +651,46 @@ EfiBootManagerConnectAllConsoles (
   // Update all the console variables\r
   //\r
   gBS->LocateHandleBuffer (\r
-          ByProtocol,\r
-          &gEfiSimpleTextInProtocolGuid,\r
-          NULL,\r
-          &HandleCount,\r
-          &HandleBuffer\r
-          );\r
+         ByProtocol,\r
+         &gEfiSimpleTextInProtocolGuid,\r
+         NULL,\r
+         &HandleCount,\r
+         &HandleBuffer\r
+         );\r
 \r
   for (Index = 0; Index < HandleCount; Index++) {\r
     gBS->HandleProtocol (\r
-            HandleBuffer[Index],\r
-            &gEfiDevicePathProtocolGuid,\r
-            (VOID **) &ConDevicePath\r
-            );\r
+           HandleBuffer[Index],\r
+           &gEfiDevicePathProtocolGuid,\r
+           (VOID **)&ConDevicePath\r
+           );\r
     EfiBootManagerUpdateConsoleVariable (ConIn, ConDevicePath, NULL);\r
   }\r
 \r
   if (HandleBuffer != NULL) {\r
-    FreePool(HandleBuffer);\r
+    FreePool (HandleBuffer);\r
     HandleBuffer = NULL;\r
   }\r
 \r
   gBS->LocateHandleBuffer (\r
-          ByProtocol,\r
-          &gEfiSimpleTextOutProtocolGuid,\r
-          NULL,\r
-          &HandleCount,\r
-          &HandleBuffer\r
-          );\r
+         ByProtocol,\r
+         &gEfiSimpleTextOutProtocolGuid,\r
+         NULL,\r
+         &HandleCount,\r
+         &HandleBuffer\r
+         );\r
   for (Index = 0; Index < HandleCount; Index++) {\r
     gBS->HandleProtocol (\r
-            HandleBuffer[Index],\r
-            &gEfiDevicePathProtocolGuid,\r
-            (VOID **) &ConDevicePath\r
-            );\r
+           HandleBuffer[Index],\r
+           &gEfiDevicePathProtocolGuid,\r
+           (VOID **)&ConDevicePath\r
+           );\r
     EfiBootManagerUpdateConsoleVariable (ConOut, ConDevicePath, NULL);\r
     EfiBootManagerUpdateConsoleVariable (ErrOut, ConDevicePath, NULL);\r
   }\r
 \r
   if (HandleBuffer != NULL) {\r
-    FreePool(HandleBuffer);\r
+    FreePool (HandleBuffer);\r
   }\r
 \r
   //\r
@@ -691,7 +699,6 @@ EfiBootManagerConnectAllConsoles (
   EfiBootManagerConnectAllDefaultConsoles ();\r
 }\r
 \r
-\r
 /**\r
   This function will connect all the console devices base on the console\r
   device variable ConIn, ConOut and ErrOut.\r
@@ -706,9 +713,9 @@ EfiBootManagerConnectAllDefaultConsoles (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                Status;\r
-  BOOLEAN                   OneConnected;\r
-  BOOLEAN                   SystemTableUpdated;\r
+  EFI_STATUS  Status;\r
+  BOOLEAN     OneConnected;\r
+  BOOLEAN     SystemTableUpdated;\r
 \r
   OneConnected = FALSE;\r
 \r
@@ -716,32 +723,36 @@ EfiBootManagerConnectAllDefaultConsoles (
   if (!EFI_ERROR (Status)) {\r
     OneConnected = TRUE;\r
   }\r
-  PERF_EVENT ("ConOutReady");\r
 \r
+  PERF_EVENT ("ConOutReady");\r
 \r
   Status = EfiBootManagerConnectConsoleVariable (ConIn);\r
   if (!EFI_ERROR (Status)) {\r
     OneConnected = TRUE;\r
   }\r
+\r
   PERF_EVENT ("ConInReady");\r
 \r
   Status = EfiBootManagerConnectConsoleVariable (ErrOut);\r
   if (!EFI_ERROR (Status)) {\r
     OneConnected = TRUE;\r
   }\r
+\r
   PERF_EVENT ("ErrOutReady");\r
 \r
   SystemTableUpdated = FALSE;\r
   //\r
   // Fill console handles in System Table if no console device assignd.\r
   //\r
-  if (BmUpdateSystemTableConsole (L"ConIn", &gEfiSimpleTextInProtocolGuid, &gST->ConsoleInHandle, (VOID **) &gST->ConIn)) {\r
+  if (BmUpdateSystemTableConsole (L"ConIn", &gEfiSimpleTextInProtocolGuid, &gST->ConsoleInHandle, (VOID **)&gST->ConIn)) {\r
     SystemTableUpdated = TRUE;\r
   }\r
-  if (BmUpdateSystemTableConsole (L"ConOut", &gEfiSimpleTextOutProtocolGuid, &gST->ConsoleOutHandle, (VOID **) &gST->ConOut)) {\r
+\r
+  if (BmUpdateSystemTableConsole (L"ConOut", &gEfiSimpleTextOutProtocolGuid, &gST->ConsoleOutHandle, (VOID **)&gST->ConOut)) {\r
     SystemTableUpdated = TRUE;\r
   }\r
-  if (BmUpdateSystemTableConsole (L"ErrOut", &gEfiSimpleTextOutProtocolGuid, &gST->StandardErrorHandle, (VOID **) &gST->StdErr)) {\r
+\r
+  if (BmUpdateSystemTableConsole (L"ErrOut", &gEfiSimpleTextOutProtocolGuid, &gST->StandardErrorHandle, (VOID **)&gST->StdErr)) {\r
     SystemTableUpdated = TRUE;\r
   }\r
 \r
@@ -751,10 +762,10 @@ EfiBootManagerConnectAllDefaultConsoles (
     //\r
     gST->Hdr.CRC32 = 0;\r
     gBS->CalculateCrc32 (\r
-          (UINT8 *) &gST->Hdr,\r
-          gST->Hdr.HeaderSize,\r
-          &gST->Hdr.CRC32\r
-          );\r
+           (UINT8 *)&gST->Hdr,\r
+           gST->Hdr.HeaderSize,\r
+           &gST->Hdr.CRC32\r
+           );\r
   }\r
 \r
   return OneConnected ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r