]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/BdsLib/BdsFilePath.c
ARM Packages: Fixed coding style and typos
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsFilePath.c
index 2c93243795ca1f446f89a8cab5d591b74d8738f7..2f8788ad1f56daeca66db165c27451baba30abb1 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
 *  \r
 *  This program and the accompanying materials                          \r
 *  are licensed and made available under the terms and conditions of the BSD License         \r
@@ -77,14 +77,14 @@ BdsGetDeviceUsb (
   // Get all the UsbIo handles\r
   UsbIoHandleCount = 0;\r
   Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiUsbIoProtocolGuid, NULL, &UsbIoHandleCount, &UsbIoBuffer);\r
-  if (EFI_ERROR(Status) || (UsbIoHandleCount == 0)) {\r
+  if (EFI_ERROR (Status) || (UsbIoHandleCount == 0)) {\r
     return Status;\r
   }\r
 \r
   // Check if one of the handles matches the USB description\r
   for (Index = 0; Index < UsbIoHandleCount; Index++) {\r
     Status = gBS->HandleProtocol (UsbIoBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **) &UsbIoDevicePath);\r
-    if (!EFI_ERROR(Status)) {\r
+    if (!EFI_ERROR (Status)) {\r
       TmpDevicePath = UsbIoDevicePath;\r
       while (!IsDevicePathEnd (TmpDevicePath)) {\r
         // Check if the Device Path node is a USB Removable device Path node\r
@@ -94,11 +94,11 @@ BdsGetDeviceUsb (
             WwidDevicePath2 = (USB_WWID_DEVICE_PATH*)TmpDevicePath;\r
             if ((WwidDevicePath1->VendorId == WwidDevicePath2->VendorId) &&\r
                 (WwidDevicePath1->ProductId == WwidDevicePath2->ProductId) &&\r
-                (CompareMem (WwidDevicePath1+1, WwidDevicePath2+1, DevicePathNodeLength(WwidDevicePath1)-sizeof(USB_WWID_DEVICE_PATH)) == 0))\r
+                (CompareMem (WwidDevicePath1+1, WwidDevicePath2+1, DevicePathNodeLength(WwidDevicePath1)-sizeof (USB_WWID_DEVICE_PATH)) == 0))\r
             {\r
               *DeviceHandle = UsbIoBuffer[Index];\r
               // Add the additional original Device Path Nodes (eg: FilePath Device Path Node) to the new Device Path\r
-              *NewDevicePath = AppendDevicePath (UsbIoDevicePath, NextDevicePathNode(RemovableDevicePath));\r
+              *NewDevicePath = AppendDevicePath (UsbIoDevicePath, NextDevicePathNode (RemovableDevicePath));\r
               return EFI_SUCCESS;\r
             }\r
           } else {\r
@@ -112,7 +112,7 @@ BdsGetDeviceUsb (
             {\r
               *DeviceHandle = UsbIoBuffer[Index];\r
               // Add the additional original Device Path Nodes (eg: FilePath Device Path Node) to the new Device Path\r
-              *NewDevicePath = AppendDevicePath (UsbIoDevicePath, NextDevicePathNode(RemovableDevicePath));\r
+              *NewDevicePath = AppendDevicePath (UsbIoDevicePath, NextDevicePathNode (RemovableDevicePath));\r
               return EFI_SUCCESS;\r
             }\r
           }\r
@@ -131,7 +131,7 @@ BdsIsRemovableHd (
   IN  EFI_DEVICE_PATH*  DevicePath\r
   )\r
 {\r
-  return IS_DEVICE_PATH_NODE(DevicePath, MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP);\r
+  return IS_DEVICE_PATH_NODE (DevicePath, MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP);\r
 }\r
 \r
 EFI_STATUS\r
@@ -153,14 +153,14 @@ BdsGetDeviceHd (
   // Get all the DiskIo handles\r
   PartitionHandleCount = 0;\r
   Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiDiskIoProtocolGuid, NULL, &PartitionHandleCount, &PartitionBuffer);\r
-  if (EFI_ERROR(Status) || (PartitionHandleCount == 0)) {\r
+  if (EFI_ERROR (Status) || (PartitionHandleCount == 0)) {\r
     return Status;\r
   }\r
 \r
   // Check if one of the handles matches the Hard Disk Description\r
   for (Index = 0; Index < PartitionHandleCount; Index++) {\r
     Status = gBS->HandleProtocol (PartitionBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **) &PartitionDevicePath);\r
-    if (!EFI_ERROR(Status)) {\r
+    if (!EFI_ERROR (Status)) {\r
       TmpDevicePath = PartitionDevicePath;\r
       while (!IsDevicePathEnd (TmpDevicePath)) {\r
         // Check if the Device Path node is a HD Removable device Path node\r
@@ -168,12 +168,12 @@ BdsGetDeviceHd (
           HardDriveDevicePath1 = (HARDDRIVE_DEVICE_PATH*)RemovableDevicePath;\r
           HardDriveDevicePath2 = (HARDDRIVE_DEVICE_PATH*)TmpDevicePath;\r
           if ((HardDriveDevicePath1->SignatureType == HardDriveDevicePath2->SignatureType) &&\r
-              (CompareGuid ((EFI_GUID *)HardDriveDevicePath1->Signature,(EFI_GUID *)HardDriveDevicePath2->Signature) == TRUE) &&\r
+              (CompareGuid ((EFI_GUID *)HardDriveDevicePath1->Signature, (EFI_GUID *)HardDriveDevicePath2->Signature) == TRUE) &&\r
               (HardDriveDevicePath1->PartitionNumber == HardDriveDevicePath2->PartitionNumber))\r
           {\r
             *DeviceHandle = PartitionBuffer[Index];\r
             // Add the additional original Device Path Nodes (eg: FilePath Device Path Node) to the new Device Path\r
-            *NewDevicePath = AppendDevicePath (PartitionDevicePath, NextDevicePathNode(RemovableDevicePath));\r
+            *NewDevicePath = AppendDevicePath (PartitionDevicePath, NextDevicePathNode (RemovableDevicePath));\r
             return EFI_SUCCESS;\r
           }\r
         }\r
@@ -191,7 +191,7 @@ BdsIsRemovableCdrom (
   IN  EFI_DEVICE_PATH*  DevicePath\r
   )\r
 {\r
-  return IS_DEVICE_PATH_NODE(DevicePath, MEDIA_DEVICE_PATH, MEDIA_CDROM_DP);\r
+  return IS_DEVICE_PATH_NODE (DevicePath, MEDIA_DEVICE_PATH, MEDIA_CDROM_DP);\r
 }\r
 \r
 EFI_STATUS\r
@@ -239,8 +239,8 @@ IsRemovableDevice (
 \r
   TmpDevicePath = DevicePath;\r
   while (!IsDevicePathEnd (TmpDevicePath)) {\r
-    for (Index = 0; Index < sizeof(RemovableDeviceSupport) / sizeof(BDS_REMOVABLE_DEVICE_SUPPORT); Index++) {\r
-      if (RemovableDeviceSupport[Index].IsRemovable(TmpDevicePath)) {\r
+    for (Index = 0; Index < sizeof (RemovableDeviceSupport) / sizeof (BDS_REMOVABLE_DEVICE_SUPPORT); Index++) {\r
+      if (RemovableDeviceSupport[Index].IsRemovable (TmpDevicePath)) {\r
         return TRUE;\r
       }\r
     }\r
@@ -271,9 +271,9 @@ TryRemovableDevice (
   TmpDevicePath       = DevicePath;\r
 \r
   while (!IsDevicePathEnd (TmpDevicePath) && !RemovableFound) {\r
-    for (Index = 0; Index < sizeof(RemovableDeviceSupport) / sizeof(BDS_REMOVABLE_DEVICE_SUPPORT); Index++) {\r
+    for (Index = 0; Index < sizeof (RemovableDeviceSupport) / sizeof (BDS_REMOVABLE_DEVICE_SUPPORT); Index++) {\r
       RemovableDevice = &RemovableDeviceSupport[Index];\r
-      if (RemovableDevice->IsRemovable(TmpDevicePath)) {\r
+      if (RemovableDevice->IsRemovable (TmpDevicePath)) {\r
         RemovableDevicePath = TmpDevicePath;\r
         RemovableFound = TRUE;\r
         break;\r
@@ -338,7 +338,7 @@ BdsConnectDevicePath (
     }\r
 \r
     /*// We need to check if RemainingDevicePath does not point on the last node. Otherwise, calling\r
-    // NextDevicePathNode() will return an undetermined Device Path Node\r
+    // NextDevicePathNode () will return an undetermined Device Path Node\r
     if (!IsDevicePathEnd (RemainingDevicePath)) {\r
       RemainingDevicePath = NextDevicePathNode (RemainingDevicePath);\r
     }*/\r
@@ -348,7 +348,7 @@ BdsConnectDevicePath (
     // Now, we have got the whole Device Path connected, call again ConnectController to ensure all the supported Driver\r
     // Binding Protocol are connected (such as DiskIo and SimpleFileSystem)\r
     Remaining = DevicePath;\r
-    Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid,&Remaining,Handle);\r
+    Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &Remaining, Handle);\r
     if (!EFI_ERROR (Status)) {\r
       Status = gBS->ConnectController (*Handle, NULL, Remaining, FALSE);\r
       if (EFI_ERROR (Status)) {\r
@@ -393,9 +393,9 @@ BdsFileSystemSupport (
   EFI_STATUS  Status;\r
   EFI_SIMPLE_FILE_SYSTEM_PROTOCOL     *FsProtocol;\r
 \r
-  Status = gBS->HandleProtocol (Handle,&gEfiSimpleFileSystemProtocolGuid, (VOID **)&FsProtocol);\r
+  Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **)&FsProtocol);\r
 \r
-  return (!EFI_ERROR(Status) && IS_DEVICE_PATH_NODE(RemainingDevicePath,MEDIA_DEVICE_PATH,MEDIA_FILEPATH_DP));\r
+  return (!EFI_ERROR (Status) && IS_DEVICE_PATH_NODE (RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP));\r
 }\r
 \r
 EFI_STATUS\r
@@ -416,32 +416,32 @@ BdsFileSystemLoadImage (
   EFI_FILE_PROTOCOL   *File;\r
   UINTN               Size;\r
 \r
-  ASSERT (IS_DEVICE_PATH_NODE(RemainingDevicePath,MEDIA_DEVICE_PATH,MEDIA_FILEPATH_DP));\r
+  ASSERT (IS_DEVICE_PATH_NODE (RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP));\r
 \r
   FilePathDevicePath = (FILEPATH_DEVICE_PATH*)RemainingDevicePath;\r
 \r
-  Status = gBS->HandleProtocol(Handle,&gEfiSimpleFileSystemProtocolGuid, (VOID **)&FsProtocol);\r
-  if (EFI_ERROR(Status)) {\r
+  Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **)&FsProtocol);\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   // Try to Open the volume and get root directory\r
   Status = FsProtocol->OpenVolume (FsProtocol, &Fs);\r
-  if (EFI_ERROR(Status)) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   File = NULL;\r
-  Status = Fs->Open(Fs, &File, FilePathDevicePath->PathName, EFI_FILE_MODE_READ, 0);\r
-  if (EFI_ERROR(Status)) {\r
+  Status = Fs->Open (Fs, &File, FilePathDevicePath->PathName, EFI_FILE_MODE_READ, 0);\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   Size = 0;\r
-  File->GetInfo(File, &gEfiFileInfoGuid, &Size, NULL);\r
+  File->GetInfo (File, &gEfiFileInfoGuid, &Size, NULL);\r
   FileInfo = AllocatePool (Size);\r
-  Status = File->GetInfo(File, &gEfiFileInfoGuid, &Size, FileInfo);\r
-  if (EFI_ERROR(Status)) {\r
+  Status = File->GetInfo (File, &gEfiFileInfoGuid, &Size, FileInfo);\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
@@ -450,14 +450,14 @@ BdsFileSystemLoadImage (
   if (ImageSize) {\r
     *ImageSize = Size;\r
   }\r
-  FreePool(FileInfo);\r
+  FreePool (FileInfo);\r
 \r
   Status = gBS->AllocatePages (Type, EfiBootServicesCode, EFI_SIZE_TO_PAGES(Size), Image);\r
   // Try to allocate in any pages if failed to allocate memory at the defined location\r
   if ((Status == EFI_OUT_OF_RESOURCES) && (Type != AllocateAnyPages)) {\r
     Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesCode, EFI_SIZE_TO_PAGES(Size), Image);\r
   }\r
-  if (!EFI_ERROR(Status)) {\r
+  if (!EFI_ERROR (Status)) {\r
     Status = File->Read (File, &Size, (VOID*)(UINTN)(*Image));\r
   }\r
 \r
@@ -471,8 +471,8 @@ BdsMemoryMapSupport (
   IN EFI_DEVICE_PATH *RemainingDevicePath\r
   )\r
 {\r
-  return IS_DEVICE_PATH_NODE(DevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP) ||\r
-         IS_DEVICE_PATH_NODE(RemainingDevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP);\r
+  return IS_DEVICE_PATH_NODE (DevicePath, HARDWARE_DEVICE_PATH, HW_MEMMAP_DP) ||\r
+         IS_DEVICE_PATH_NODE (RemainingDevicePath, HARDWARE_DEVICE_PATH, HW_MEMMAP_DP);\r
 }\r
 \r
 EFI_STATUS\r
@@ -489,10 +489,10 @@ BdsMemoryMapLoadImage (
   MEMMAP_DEVICE_PATH*   MemMapPathDevicePath;\r
   UINTN                 Size;\r
 \r
-  if (IS_DEVICE_PATH_NODE(RemainingDevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP)) {\r
+  if (IS_DEVICE_PATH_NODE (RemainingDevicePath, HARDWARE_DEVICE_PATH, HW_MEMMAP_DP)) {\r
     MemMapPathDevicePath = (MEMMAP_DEVICE_PATH*)RemainingDevicePath;\r
   } else {\r
-    ASSERT (IS_DEVICE_PATH_NODE(DevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP));\r
+    ASSERT (IS_DEVICE_PATH_NODE (DevicePath, HARDWARE_DEVICE_PATH, HW_MEMMAP_DP));\r
     MemMapPathDevicePath = (MEMMAP_DEVICE_PATH*)DevicePath;\r
   }\r
 \r
@@ -506,7 +506,7 @@ BdsMemoryMapLoadImage (
   if ((Status == EFI_OUT_OF_RESOURCES) && (Type != AllocateAnyPages)) {\r
     Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesCode, EFI_SIZE_TO_PAGES(Size), Image);\r
   }\r
-  if (!EFI_ERROR(Status)) {\r
+  if (!EFI_ERROR (Status)) {\r
     CopyMem ((VOID*)(UINTN)(*Image), (CONST VOID*)(UINTN)MemMapPathDevicePath->StartingAddress, Size);\r
 \r
     if (ImageSize != NULL) {\r
@@ -524,7 +524,7 @@ BdsFirmwareVolumeSupport (
   IN EFI_DEVICE_PATH *RemainingDevicePath\r
   )\r
 {\r
-  return IS_DEVICE_PATH_NODE(RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_PIWG_FW_FILE_DP);\r
+  return IS_DEVICE_PATH_NODE (RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_PIWG_FW_FILE_DP);\r
 }\r
 \r
 EFI_STATUS\r
@@ -546,10 +546,10 @@ BdsFirmwareVolumeLoadImage (
   UINT32                            AuthenticationStatus;\r
   VOID* ImageBuffer;\r
 \r
-  ASSERT (IS_DEVICE_PATH_NODE(RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_PIWG_FW_FILE_DP));\r
+  ASSERT (IS_DEVICE_PATH_NODE (RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_PIWG_FW_FILE_DP));\r
 \r
-  Status = gBS->HandleProtocol(Handle,&gEfiFirmwareVolume2ProtocolGuid, (VOID **)&FwVol);\r
-  if (EFI_ERROR(Status)) {\r
+  Status = gBS->HandleProtocol (Handle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&FwVol);\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
@@ -576,7 +576,7 @@ BdsFirmwareVolumeLoadImage (
     // In case the buffer has some address requirements, we must copy the buffer to a buffer following the requirements\r
     if (Type != AllocateAnyPages) {\r
       Status = gBS->AllocatePages (Type, EfiBootServicesCode, EFI_SIZE_TO_PAGES(*ImageSize),Image);\r
-      if (!EFI_ERROR(Status)) {\r
+      if (!EFI_ERROR (Status)) {\r
         CopyMem ((VOID*)(UINTN)(*Image), ImageBuffer, *ImageSize);\r
         FreePool (ImageBuffer);\r
       }\r
@@ -588,7 +588,7 @@ BdsFirmwareVolumeLoadImage (
     if ((Status == EFI_OUT_OF_RESOURCES) && (Type != AllocateAnyPages)) {\r
       Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesCode, EFI_SIZE_TO_PAGES(*ImageSize), Image);\r
     }\r
-    if (!EFI_ERROR(Status)) {\r
+    if (!EFI_ERROR (Status)) {\r
       CopyMem ((VOID*)(UINTN)(*Image), ImageBuffer, *ImageSize);\r
       FreePool (ImageBuffer);\r
     }\r
@@ -604,13 +604,13 @@ BdsFirmwareVolumeLoadImage (
                         &Attrib,\r
                         &AuthenticationStatus\r
                         );\r
-    if (!EFI_ERROR(Status)) {\r
+    if (!EFI_ERROR (Status)) {\r
       Status = gBS->AllocatePages (Type, EfiBootServicesCode, EFI_SIZE_TO_PAGES(*ImageSize), Image);\r
       // Try to allocate in any pages if failed to allocate memory at the defined location\r
       if ((Status == EFI_OUT_OF_RESOURCES) && (Type != AllocateAnyPages)) {\r
         Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesCode, EFI_SIZE_TO_PAGES(*ImageSize), Image);\r
       }\r
-      if (!EFI_ERROR(Status)) {\r
+      if (!EFI_ERROR (Status)) {\r
         Status = FwVol->ReadFile (\r
                                 FwVol,\r
                                 FvNameGuid,\r
@@ -636,7 +636,7 @@ BdsPxeSupport (
   EFI_STATUS                  Status;\r
   EFI_PXE_BASE_CODE_PROTOCOL* PxeBcProtocol;\r
 \r
-  if (!IsDevicePathEnd(RemainingDevicePath)) {\r
+  if (!IsDevicePathEnd (RemainingDevicePath)) {\r
     return FALSE;\r
   }\r
 \r
@@ -671,12 +671,12 @@ BdsPxeLoadImage (
   Status = LoadFileProtocol->LoadFile (LoadFileProtocol, DevicePath, TRUE, &BufferSize, NULL);\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     Status = gBS->AllocatePages (Type, EfiBootServicesCode, EFI_SIZE_TO_PAGES(BufferSize), Image);\r
-    if (EFI_ERROR(Status)) {\r
+    if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
 \r
     Status = LoadFileProtocol->LoadFile (LoadFileProtocol, DevicePath, TRUE, &BufferSize, (VOID*)(UINTN)(*Image));\r
-    if (!EFI_ERROR(Status) && (ImageSize != NULL)) {\r
+    if (!EFI_ERROR (Status) && (ImageSize != NULL)) {\r
       *ImageSize = BufferSize;\r
     }\r
   }\r
@@ -696,18 +696,18 @@ BdsTftpSupport (
   EFI_PXE_BASE_CODE_PROTOCOL  *PxeBcProtocol;\r
 \r
   // Validate the Remaining Device Path\r
-  if (IsDevicePathEnd(RemainingDevicePath)) {\r
+  if (IsDevicePathEnd (RemainingDevicePath)) {\r
     return FALSE;\r
   }\r
-  if (!IS_DEVICE_PATH_NODE(RemainingDevicePath,MESSAGING_DEVICE_PATH,MSG_IPv4_DP) &&\r
-      !IS_DEVICE_PATH_NODE(RemainingDevicePath,MESSAGING_DEVICE_PATH,MSG_IPv6_DP)) {\r
+  if (!IS_DEVICE_PATH_NODE (RemainingDevicePath, MESSAGING_DEVICE_PATH, MSG_IPv4_DP) &&\r
+      !IS_DEVICE_PATH_NODE (RemainingDevicePath, MESSAGING_DEVICE_PATH, MSG_IPv6_DP)) {\r
     return FALSE;\r
   }\r
   NextDevicePath = NextDevicePathNode (RemainingDevicePath);\r
-  if (IsDevicePathEnd(NextDevicePath)) {\r
+  if (IsDevicePathEnd (NextDevicePath)) {\r
     return FALSE;\r
   }\r
-  if (!IS_DEVICE_PATH_NODE(NextDevicePath,MEDIA_DEVICE_PATH,MEDIA_FILEPATH_DP)) {\r
+  if (!IS_DEVICE_PATH_NODE (NextDevicePath, MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP)) {\r
     return FALSE;\r
   }\r
 \r
@@ -738,18 +738,18 @@ BdsTftpLoadImage (
   FILEPATH_DEVICE_PATH*       FilePathDevicePath;\r
   EFI_IP_ADDRESS              LocalIp;\r
 \r
-  ASSERT(IS_DEVICE_PATH_NODE(RemainingDevicePath,MESSAGING_DEVICE_PATH,MSG_IPv4_DP));\r
+  ASSERT(IS_DEVICE_PATH_NODE (RemainingDevicePath, MESSAGING_DEVICE_PATH, MSG_IPv4_DP));\r
 \r
   IPv4DevicePathNode = (IPv4_DEVICE_PATH*)RemainingDevicePath;\r
   FilePathDevicePath = (FILEPATH_DEVICE_PATH*)(IPv4DevicePathNode + 1);\r
 \r
   Status = gBS->LocateProtocol (&gEfiPxeBaseCodeProtocolGuid, NULL, (VOID **)&Pxe);\r
-  if (EFI_ERROR(Status)) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   Status = Pxe->Start (Pxe, FALSE);\r
-  if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) {\r
+  if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {\r
     return Status;\r
   }\r
 \r
@@ -759,7 +759,7 @@ BdsTftpLoadImage (
     CopyMem (&LocalIp.v4, &IPv4DevicePathNode->LocalIpAddress, sizeof (EFI_IPv4_ADDRESS));\r
     Status = Pxe->SetStationIp (Pxe, &LocalIp, NULL);\r
   }\r
-  if (EFI_ERROR(Status)) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
@@ -777,12 +777,12 @@ BdsTftpLoadImage (
                   NULL,\r
                   TRUE\r
                   );\r
-  if (EFI_ERROR(Status)) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   // Allocate a buffer to hold the whole file.\r
-  TftpBuffer = AllocatePool(TftpBufferSize);\r
+  TftpBuffer = AllocatePool (TftpBufferSize);\r
   if (TftpBuffer == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -799,8 +799,8 @@ BdsTftpLoadImage (
                   NULL,\r
                   FALSE\r
                   );\r
-  if (EFI_ERROR(Status)) {\r
-    FreePool(TftpBuffer);\r
+  if (EFI_ERROR (Status)) {\r
+    FreePool (TftpBuffer);\r
   } else if (ImageSize != NULL) {\r
     *ImageSize = (UINTN)TftpBufferSize;\r
   }\r
@@ -874,20 +874,20 @@ BdsStartEfiApplication (
 \r
   // Find the nearest supported file loader\r
   Status = BdsLoadImage (DevicePath, AllocateAnyPages, &BinaryBuffer, &BinarySize);\r
-  if (EFI_ERROR(Status)) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   // Load the image from the Buffer with Boot Services function\r
   Status = gBS->LoadImage (TRUE, ParentImageHandle, DevicePath, (VOID*)(UINTN)BinaryBuffer, BinarySize, &ImageHandle);\r
-  if (EFI_ERROR(Status)) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   // Passed LoadOptions to the EFI Application\r
   if (LoadOptionsSize != 0) {\r
     Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage);\r
-    if (EFI_ERROR(Status)) {\r
+    if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
 \r