]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UdfDxe / FileSystemOperations.c
index e9e55cb2ba4d7bf0c234e64edbad33fd67aca749..2998c3369cc9d27f3ba97c252e61ce8309d0840f 100644 (file)
@@ -12,7 +12,7 @@
 //\r
 // Vendor-Defined Device Path GUID for UDF file system\r
 //\r
-EFI_GUID gUdfDevPathGuid = EFI_UDF_DEVICE_PATH_GUID;\r
+EFI_GUID  gUdfDevPathGuid = EFI_UDF_DEVICE_PATH_GUID;\r
 \r
 /**\r
   Find the anchor volume descriptor pointer.\r
@@ -40,8 +40,8 @@ FindAnchorVolumeDescriptorPointer (
   UINTN               Index;\r
   UDF_DESCRIPTOR_TAG  *DescriptorTag;\r
 \r
-  BlockSize = BlockIo->Media->BlockSize;\r
-  EndLBA = BlockIo->Media->LastBlock;\r
+  BlockSize         = BlockIo->Media->BlockSize;\r
+  EndLBA            = BlockIo->Media->LastBlock;\r
   DescriptorLBAs[0] = 256;\r
   DescriptorLBAs[1] = EndLBA - 256;\r
   DescriptorLBAs[2] = EndLBA;\r
@@ -49,12 +49,12 @@ FindAnchorVolumeDescriptorPointer (
 \r
   for (Index = 0; Index < ARRAY_SIZE (DescriptorLBAs); Index++) {\r
     Status = DiskIo->ReadDisk (\r
-      DiskIo,\r
-      BlockIo->Media->MediaId,\r
-      MultU64x32 (DescriptorLBAs[Index], BlockSize),\r
-      sizeof (UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER),\r
-      (VOID *)AnchorPoint\r
-      );\r
+                       DiskIo,\r
+                       BlockIo->Media->MediaId,\r
+                       MultU64x32 (DescriptorLBAs[Index], BlockSize),\r
+                       sizeof (UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER),\r
+                       (VOID *)AnchorPoint\r
+                       );\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
@@ -68,6 +68,7 @@ FindAnchorVolumeDescriptorPointer (
       return EFI_SUCCESS;\r
     }\r
   }\r
+\r
   //\r
   // No AVDP found.\r
   //\r
@@ -98,18 +99,18 @@ StartMainVolumeDescriptorSequence (
   OUT  UDF_VOLUME_INFO                       *Volume\r
   )\r
 {\r
-  EFI_STATUS            Status;\r
-  UINT32                BlockSize;\r
-  UDF_EXTENT_AD         *ExtentAd;\r
-  EFI_LBA               SeqStartBlock;\r
-  EFI_LBA               SeqEndBlock;\r
-  BOOLEAN               StopSequence;\r
-  VOID                  *Buffer;\r
-  UDF_DESCRIPTOR_TAG    *DescriptorTag;\r
-  UINT32                LogicalBlockSize;\r
+  EFI_STATUS          Status;\r
+  UINT32              BlockSize;\r
+  UDF_EXTENT_AD       *ExtentAd;\r
+  EFI_LBA             SeqStartBlock;\r
+  EFI_LBA             SeqEndBlock;\r
+  BOOLEAN             StopSequence;\r
+  VOID                *Buffer;\r
+  UDF_DESCRIPTOR_TAG  *DescriptorTag;\r
+  UINT32              LogicalBlockSize;\r
 \r
   BlockSize = BlockIo->Media->BlockSize;\r
-  ExtentAd = &AnchorPoint->MainVolumeDescriptorSequenceExtent;\r
+  ExtentAd  = &AnchorPoint->MainVolumeDescriptorSequenceExtent;\r
 \r
   //\r
   // Allocate buffer for reading disk blocks\r
@@ -128,20 +129,22 @@ StartMainVolumeDescriptorSequence (
   // Partition driver already did.\r
   //\r
   SeqStartBlock = 0;\r
-  SeqEndBlock = SeqStartBlock + DivU64x32 ((UINT64)ExtentAd->ExtentLength,\r
-                                           BlockSize);\r
+  SeqEndBlock   = SeqStartBlock + DivU64x32 (\r
+                                    (UINT64)ExtentAd->ExtentLength,\r
+                                    BlockSize\r
+                                    );\r
   StopSequence = FALSE;\r
-  for (; SeqStartBlock < SeqEndBlock && !StopSequence; SeqStartBlock++) {\r
+  for ( ; SeqStartBlock < SeqEndBlock && !StopSequence; SeqStartBlock++) {\r
     //\r
     // Read disk block\r
     //\r
     Status = BlockIo->ReadBlocks (\r
-      BlockIo,\r
-      BlockIo->Media->MediaId,\r
-      SeqStartBlock,\r
-      BlockSize,\r
-      Buffer\r
-      );\r
+                        BlockIo,\r
+                        BlockIo->Media->MediaId,\r
+                        SeqStartBlock,\r
+                        BlockSize,\r
+                        Buffer\r
+                        );\r
     if (EFI_ERROR (Status)) {\r
       goto Out_Free;\r
     }\r
@@ -149,26 +152,26 @@ StartMainVolumeDescriptorSequence (
     DescriptorTag = Buffer;\r
 \r
     switch (DescriptorTag->TagIdentifier) {\r
-    case UdfPartitionDescriptor:\r
-      //\r
-      // Save Partition Descriptor\r
-      //\r
-      CopyMem (&Volume->PartitionDesc, Buffer, sizeof (Volume->PartitionDesc));\r
-      break;\r
+      case UdfPartitionDescriptor:\r
+        //\r
+        // Save Partition Descriptor\r
+        //\r
+        CopyMem (&Volume->PartitionDesc, Buffer, sizeof (Volume->PartitionDesc));\r
+        break;\r
 \r
-    case UdfLogicalVolumeDescriptor:\r
-      //\r
-      // Save Logical Volume Descriptor\r
-      //\r
-      CopyMem (&Volume->LogicalVolDesc, Buffer, sizeof (Volume->LogicalVolDesc));\r
-      break;\r
+      case UdfLogicalVolumeDescriptor:\r
+        //\r
+        // Save Logical Volume Descriptor\r
+        //\r
+        CopyMem (&Volume->LogicalVolDesc, Buffer, sizeof (Volume->LogicalVolDesc));\r
+        break;\r
 \r
-    case UdfTerminatingDescriptor:\r
-      StopSequence = TRUE;\r
-      break;\r
+      case UdfTerminatingDescriptor:\r
+        StopSequence = TRUE;\r
+        break;\r
 \r
-    default:\r
-      ;\r
+      default:\r
+        ;\r
     }\r
   }\r
 \r
@@ -216,45 +219,46 @@ GetPdFromLongAd (
   LogicalVolDesc = &Volume->LogicalVolDesc;\r
 \r
   switch (LogicalVolDesc->DomainIdentifier.Suffix.Domain.UdfRevision) {\r
-  case 0x0102:\r
-  case 0x0150:\r
-  case 0x0200:\r
-  case 0x0201:\r
-  case 0x0250:\r
-  case 0x0260:\r
-    //\r
-    // UDF 1.02 specification:\r
-    //\r
-    // There shall be exactly one prevailing Logical Volume Descriptor recorded\r
-    // per Volume Set. The Partition Maps field shall contain only Type 1\r
-    // Partition Maps.\r
-    //\r
-    // UDF 1.50 through 2.60 specs say:\r
-    //\r
-    // For the purpose of interchange partition maps shall be limited to\r
-    // Partition Map type 1, except type 2 maps as described in the document.\r
-    //\r
-    // NOTE: Only one Type 1 (Physical) Partition is supported. It has been\r
-    // checked already in Partition driver for existence of a single Type 1\r
-    // Partition map. Hence, the 'PartitionReferenceNumber' field (the index\r
-    // used to access Partition Maps data within the Logical Volume Descriptor)\r
-    // in the Long Allocation Descriptor should be 0 to indicate there is only\r
-    // one partition.\r
-    //\r
-    if (LongAd->ExtentLocation.PartitionReferenceNumber != 0) {\r
-      return NULL;\r
-    }\r
-    //\r
-    // Since only one partition, get the first one directly.\r
-    //\r
-    PartitionNum = *(UINT16 *)((UINTN)&LogicalVolDesc->PartitionMaps[4]);\r
-    break;\r
+    case 0x0102:\r
+    case 0x0150:\r
+    case 0x0200:\r
+    case 0x0201:\r
+    case 0x0250:\r
+    case 0x0260:\r
+      //\r
+      // UDF 1.02 specification:\r
+      //\r
+      // There shall be exactly one prevailing Logical Volume Descriptor recorded\r
+      // per Volume Set. The Partition Maps field shall contain only Type 1\r
+      // Partition Maps.\r
+      //\r
+      // UDF 1.50 through 2.60 specs say:\r
+      //\r
+      // For the purpose of interchange partition maps shall be limited to\r
+      // Partition Map type 1, except type 2 maps as described in the document.\r
+      //\r
+      // NOTE: Only one Type 1 (Physical) Partition is supported. It has been\r
+      // checked already in Partition driver for existence of a single Type 1\r
+      // Partition map. Hence, the 'PartitionReferenceNumber' field (the index\r
+      // used to access Partition Maps data within the Logical Volume Descriptor)\r
+      // in the Long Allocation Descriptor should be 0 to indicate there is only\r
+      // one partition.\r
+      //\r
+      if (LongAd->ExtentLocation.PartitionReferenceNumber != 0) {\r
+        return NULL;\r
+      }\r
 \r
-  default:\r
-    //\r
-    // Unsupported UDF revision\r
-    //\r
-    return NULL;\r
+      //\r
+      // Since only one partition, get the first one directly.\r
+      //\r
+      PartitionNum = *(UINT16 *)((UINTN)&LogicalVolDesc->PartitionMaps[4]);\r
+      break;\r
+\r
+    default:\r
+      //\r
+      // Unsupported UDF revision\r
+      //\r
+      return NULL;\r
   }\r
 \r
   //\r
@@ -287,7 +291,7 @@ GetLongAdLsn (
   OUT UINT64                          *Lsn\r
   )\r
 {\r
-  UDF_PARTITION_DESCRIPTOR *PartitionDesc;\r
+  UDF_PARTITION_DESCRIPTOR  *PartitionDesc;\r
 \r
   PartitionDesc = GetPdFromLongAd (Volume, LongAd);\r
   if (PartitionDesc == NULL) {\r
@@ -324,7 +328,7 @@ GetShortAdLsn (
   )\r
 {\r
   return (UINT64)PartitionDesc->PartitionStartingLocation -\r
-    Volume->MainVdsStartLocation + ShortAd->ExtentPosition;\r
+         Volume->MainVdsStartLocation + ShortAd->ExtentPosition;\r
 }\r
 \r
 /**\r
@@ -344,9 +348,9 @@ GetShortAdLsn (
 **/\r
 EFI_STATUS\r
 FindFileSetDescriptor (\r
-  IN   EFI_BLOCK_IO_PROTOCOL    *BlockIo,\r
-  IN   EFI_DISK_IO_PROTOCOL     *DiskIo,\r
-  IN   UDF_VOLUME_INFO          *Volume\r
+  IN   EFI_BLOCK_IO_PROTOCOL  *BlockIo,\r
+  IN   EFI_DISK_IO_PROTOCOL   *DiskIo,\r
+  IN   UDF_VOLUME_INFO        *Volume\r
   )\r
 {\r
   EFI_STATUS                     Status;\r
@@ -355,7 +359,7 @@ FindFileSetDescriptor (
   UDF_DESCRIPTOR_TAG             *DescriptorTag;\r
 \r
   LogicalVolDesc = &Volume->LogicalVolDesc;\r
-  Status = GetLongAdLsn (Volume, &LogicalVolDesc->LogicalVolumeContentsUse, &Lsn);\r
+  Status         = GetLongAdLsn (Volume, &LogicalVolDesc->LogicalVolumeContentsUse, &Lsn);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -369,12 +373,12 @@ FindFileSetDescriptor (
   // Read disk block\r
   //\r
   Status = DiskIo->ReadDisk (\r
-    DiskIo,\r
-    BlockIo->Media->MediaId,\r
-    MultU64x32 (Lsn, LogicalVolDesc->LogicalBlockSize),\r
-    sizeof (Volume->FileSetDesc),\r
-    &Volume->FileSetDesc\r
-    );\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     MultU64x32 (Lsn, LogicalVolDesc->LogicalBlockSize),\r
+                     sizeof (Volume->FileSetDesc),\r
+                     &Volume->FileSetDesc\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -417,10 +421,10 @@ ReadVolumeFileStructure (
   // Find Anchor Volume Descriptor Pointer\r
   //\r
   Status = FindAnchorVolumeDescriptorPointer (\r
-    BlockIo,\r
-    DiskIo,\r
-    &AnchorPoint\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             &AnchorPoint\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -436,11 +440,11 @@ ReadVolumeFileStructure (
   // Start Main Volume Descriptor Sequence.\r
   //\r
   Status = StartMainVolumeDescriptorSequence (\r
-    BlockIo,\r
-    DiskIo,\r
-    &AnchorPoint,\r
-    Volume\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             &AnchorPoint,\r
+             Volume\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -462,10 +466,10 @@ GetFidDescriptorLength (
   )\r
 {\r
   return (UINT64)(\r
-             (INTN)((OFFSET_OF (UDF_FILE_IDENTIFIER_DESCRIPTOR, Data[0]) + 3 +\r
-             FileIdentifierDesc->LengthOfFileIdentifier +\r
-             FileIdentifierDesc->LengthOfImplementationUse) >> 2) << 2\r
-             );\r
+                  (INTN)((OFFSET_OF (UDF_FILE_IDENTIFIER_DESCRIPTOR, Data[0]) + 3 +\r
+                          FileIdentifierDesc->LengthOfFileIdentifier +\r
+                          FileIdentifierDesc->LengthOfImplementationUse) >> 2) << 2\r
+                  );\r
 }\r
 \r
 /**\r
@@ -483,7 +487,9 @@ DuplicateFid (
 {\r
   *NewFileIdentifierDesc =\r
     (UDF_FILE_IDENTIFIER_DESCRIPTOR *)AllocateCopyPool (\r
-      (UINTN) GetFidDescriptorLength (FileIdentifierDesc), FileIdentifierDesc);\r
+                                        (UINTN)GetFidDescriptorLength (FileIdentifierDesc),\r
+                                        FileIdentifierDesc\r
+                                        );\r
 }\r
 \r
 /**\r
@@ -549,22 +555,24 @@ GetFileEntryData (
   if (DescriptorTag->TagIdentifier == UdfExtendedFileEntry) {\r
     ExtendedFileEntry = (UDF_EXTENDED_FILE_ENTRY *)FileEntryData;\r
 \r
-    *Length  = ExtendedFileEntry->InformationLength;\r
-    *Data    = (VOID *)((UINT8 *)ExtendedFileEntry->Data +\r
-                        ExtendedFileEntry->LengthOfExtendedAttributes);\r
+    *Length = ExtendedFileEntry->InformationLength;\r
+    *Data   = (VOID *)((UINT8 *)ExtendedFileEntry->Data +\r
+                       ExtendedFileEntry->LengthOfExtendedAttributes);\r
   } else if (DescriptorTag->TagIdentifier == UdfFileEntry) {\r
     FileEntry = (UDF_FILE_ENTRY *)FileEntryData;\r
 \r
-    *Length  = FileEntry->InformationLength;\r
-    *Data    = (VOID *)((UINT8 *)FileEntry->Data +\r
-                        FileEntry->LengthOfExtendedAttributes);\r
+    *Length = FileEntry->InformationLength;\r
+    *Data   = (VOID *)((UINT8 *)FileEntry->Data +\r
+                       FileEntry->LengthOfExtendedAttributes);\r
   }\r
 \r
   if ((*Length > FileEntrySize) ||\r
       ((UINTN)FileEntryData > (UINTN)(*Data)) ||\r
-      ((UINTN)(*Data) - (UINTN)FileEntryData > FileEntrySize - *Length)) {\r
+      ((UINTN)(*Data) - (UINTN)FileEntryData > FileEntrySize - *Length))\r
+  {\r
     return EFI_VOLUME_CORRUPTED;\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -606,22 +614,24 @@ GetAdsInformation (
   if (DescriptorTag->TagIdentifier == UdfExtendedFileEntry) {\r
     ExtendedFileEntry = (UDF_EXTENDED_FILE_ENTRY *)FileEntryData;\r
 \r
-    *Length = ExtendedFileEntry->LengthOfAllocationDescriptors;\r
+    *Length  = ExtendedFileEntry->LengthOfAllocationDescriptors;\r
     *AdsData = (VOID *)((UINT8 *)ExtendedFileEntry->Data +\r
                         ExtendedFileEntry->LengthOfExtendedAttributes);\r
   } else if (DescriptorTag->TagIdentifier == UdfFileEntry) {\r
     FileEntry = (UDF_FILE_ENTRY *)FileEntryData;\r
 \r
-    *Length = FileEntry->LengthOfAllocationDescriptors;\r
+    *Length  = FileEntry->LengthOfAllocationDescriptors;\r
     *AdsData = (VOID *)((UINT8 *)FileEntry->Data +\r
                         FileEntry->LengthOfExtendedAttributes);\r
   }\r
 \r
   if ((*Length > FileEntrySize) ||\r
       ((UINTN)FileEntryData > (UINTN)(*AdsData)) ||\r
-      ((UINTN)(*AdsData) - (UINTN)FileEntryData > FileEntrySize - *Length)) {\r
+      ((UINTN)(*AdsData) - (UINTN)FileEntryData > FileEntrySize - *Length))\r
+  {\r
     return EFI_VOLUME_CORRUPTED;\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -648,7 +658,7 @@ GetLongAdFromAds (
   UDF_LONG_ALLOCATION_DESCRIPTOR  *LongAd;\r
   UDF_EXTENT_FLAGS                ExtentFlags;\r
 \r
-  for (;;) {\r
+  for ( ; ;) {\r
     if (*Offset >= Length) {\r
       //\r
       // No more Long Allocation Descriptors.\r
@@ -664,8 +674,9 @@ GetLongAdFromAds (
     // allocated AD, then return it.\r
     //\r
     ExtentFlags = GET_EXTENT_FLAGS (LongAdsSequence, LongAd);\r
-    if (ExtentFlags == ExtentIsNextExtent ||\r
-        ExtentFlags == ExtentRecordedAndAllocated) {\r
+    if ((ExtentFlags == ExtentIsNextExtent) ||\r
+        (ExtentFlags == ExtentRecordedAndAllocated))\r
+    {\r
       break;\r
     }\r
 \r
@@ -701,10 +712,10 @@ GetShortAdFromAds (
   OUT     UDF_SHORT_ALLOCATION_DESCRIPTOR  **FoundShortAd\r
   )\r
 {\r
-  UDF_SHORT_ALLOCATION_DESCRIPTOR *ShortAd;\r
-  UDF_EXTENT_FLAGS                ExtentFlags;\r
+  UDF_SHORT_ALLOCATION_DESCRIPTOR  *ShortAd;\r
+  UDF_EXTENT_FLAGS                 ExtentFlags;\r
 \r
-  for (;;) {\r
+  for ( ; ;) {\r
     if (*Offset >= Length) {\r
       //\r
       // No more Short Allocation Descriptors.\r
@@ -720,8 +731,9 @@ GetShortAdFromAds (
     // allocated AD, then return it.\r
     //\r
     ExtentFlags = GET_EXTENT_FLAGS (ShortAdsSequence, ShortAd);\r
-    if (ExtentFlags == ExtentIsNextExtent ||\r
-        ExtentFlags == ExtentRecordedAndAllocated) {\r
+    if ((ExtentFlags == ExtentIsNextExtent) ||\r
+        (ExtentFlags == ExtentRecordedAndAllocated))\r
+    {\r
       break;\r
     }\r
 \r
@@ -763,18 +775,18 @@ GetAllocationDescriptor (
 {\r
   if (RecordingFlags == LongAdsSequence) {\r
     return GetLongAdFromAds (\r
-      Data,\r
-      Offset,\r
-      Length,\r
-      (UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd\r
-      );\r
+             Data,\r
+             Offset,\r
+             Length,\r
+             (UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd\r
+             );\r
   } else if (RecordingFlags == ShortAdsSequence) {\r
     return GetShortAdFromAds (\r
-      Data,\r
-      Offset,\r
-      Length,\r
-      (UDF_SHORT_ALLOCATION_DESCRIPTOR **)FoundAd\r
-      );\r
+             Data,\r
+             Offset,\r
+             Length,\r
+             (UDF_SHORT_ALLOCATION_DESCRIPTOR **)FoundAd\r
+             );\r
   }\r
 \r
   //\r
@@ -809,7 +821,7 @@ GetAllocationDescriptorLsn (
   OUT UINT64                          *Lsn\r
   )\r
 {\r
-  UDF_PARTITION_DESCRIPTOR *PartitionDesc;\r
+  UDF_PARTITION_DESCRIPTOR  *PartitionDesc;\r
 \r
   if (RecordingFlags == LongAdsSequence) {\r
     return GetLongAdLsn (Volume, (UDF_LONG_ALLOCATION_DESCRIPTOR *)Ad, Lsn);\r
@@ -875,12 +887,14 @@ GetAedAdsOffset (
   UDF_ALLOCATION_EXTENT_DESCRIPTOR  *AllocExtDesc;\r
   UDF_DESCRIPTOR_TAG                *DescriptorTag;\r
 \r
-  ExtentLength  = GET_EXTENT_LENGTH (RecordingFlags, Ad);\r
-  Status        = GetAllocationDescriptorLsn (RecordingFlags,\r
-                                              Volume,\r
-                                              ParentIcb,\r
-                                              Ad,\r
-                                              &Lsn);\r
+  ExtentLength = GET_EXTENT_LENGTH (RecordingFlags, Ad);\r
+  Status       = GetAllocationDescriptorLsn (\r
+                   RecordingFlags,\r
+                   Volume,\r
+                   ParentIcb,\r
+                   Ad,\r
+                   &Lsn\r
+                   );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -896,12 +910,12 @@ GetAedAdsOffset (
   // Read extent.\r
   //\r
   Status = DiskIo->ReadDisk (\r
-    DiskIo,\r
-    BlockIo->Media->MediaId,\r
-    MultU64x32 (Lsn, LogicalBlockSize),\r
-    ExtentLength,\r
-    Data\r
-    );\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     MultU64x32 (Lsn, LogicalBlockSize),\r
+                     ExtentLength,\r
+                     Data\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     goto Exit;\r
   }\r
@@ -922,7 +936,7 @@ GetAedAdsOffset (
   // Get AED's block offset and its length.\r
   //\r
   *Offset = MultU64x32 (Lsn, LogicalBlockSize) +\r
-    sizeof (UDF_ALLOCATION_EXTENT_DESCRIPTOR);\r
+            sizeof (UDF_ALLOCATION_EXTENT_DESCRIPTOR);\r
   *Length = AllocExtDesc->LengthOfAllocationDescriptors;\r
 \r
 Exit:\r
@@ -969,15 +983,15 @@ GetAedAdsData (
   // Get AED's offset + length.\r
   //\r
   Status = GetAedAdsOffset (\r
-    BlockIo,\r
-    DiskIo,\r
-    Volume,\r
-    ParentIcb,\r
-    RecordingFlags,\r
-    Ad,\r
-    &Offset,\r
-    Length\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume,\r
+             ParentIcb,\r
+             RecordingFlags,\r
+             Ad,\r
+             &Offset,\r
+             Length\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -985,18 +999,18 @@ GetAedAdsData (
   //\r
   // Allocate buffer to read in AED's data.\r
   //\r
-  *Data = AllocatePool ((UINTN) (*Length));\r
+  *Data = AllocatePool ((UINTN)(*Length));\r
   if (*Data == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
   return DiskIo->ReadDisk (\r
-    DiskIo,\r
-    BlockIo->Media->MediaId,\r
-    Offset,\r
-    (UINTN) (*Length),\r
-    *Data\r
-    );\r
+                   DiskIo,\r
+                   BlockIo->Media->MediaId,\r
+                   Offset,\r
+                   (UINTN)(*Length),\r
+                   *Data\r
+                   );\r
 }\r
 \r
 /**\r
@@ -1020,7 +1034,7 @@ GrowUpBufferToNextAd (
   IN      UINT64                  Length\r
   )\r
 {\r
-  UINT32 ExtentLength;\r
+  UINT32  ExtentLength;\r
 \r
   ExtentLength = GET_EXTENT_LENGTH (RecordingFlags, Ad);\r
 \r
@@ -1030,7 +1044,7 @@ GrowUpBufferToNextAd (
       return EFI_OUT_OF_RESOURCES;\r
     }\r
   } else {\r
-    *Buffer = ReallocatePool ((UINTN) Length, (UINTN) (Length + ExtentLength), *Buffer);\r
+    *Buffer = ReallocatePool ((UINTN)Length, (UINTN)(Length + ExtentLength), *Buffer);\r
     if (*Buffer == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
@@ -1087,294 +1101,297 @@ ReadFile (
   UINT32                  ExtentLength;\r
   UDF_FE_RECORDING_FLAGS  RecordingFlags;\r
 \r
-  LogicalBlockSize  = Volume->LogicalVolDesc.LogicalBlockSize;\r
-  DoFreeAed         = FALSE;\r
+  LogicalBlockSize = Volume->LogicalVolDesc.LogicalBlockSize;\r
+  DoFreeAed        = FALSE;\r
 \r
   //\r
   // set BytesLeft to suppress incorrect compiler/analyzer warnings\r
   //\r
-  BytesLeft = 0;\r
-  DataOffset = 0;\r
-  FilePosition = 0;\r
+  BytesLeft       = 0;\r
+  DataOffset      = 0;\r
+  FilePosition    = 0;\r
   FinishedSeeking = FALSE;\r
-  Data = NULL;\r
+  Data            = NULL;\r
 \r
   switch (ReadFileInfo->Flags) {\r
-  case ReadFileGetFileSize:\r
-  case ReadFileAllocateAndRead:\r
-    //\r
-    // Initialise ReadFileInfo structure for either getting file size, or\r
-    // reading file's recorded data.\r
-    //\r
-    ReadFileInfo->ReadLength = 0;\r
-    ReadFileInfo->FileData = NULL;\r
-    break;\r
-  case ReadFileSeekAndRead:\r
-    //\r
-    // About to seek a file and/or read its data.\r
-    //\r
-    Length = ReadFileInfo->FileSize - ReadFileInfo->FilePosition;\r
-    if (ReadFileInfo->FileDataSize > Length) {\r
+    case ReadFileGetFileSize:\r
+    case ReadFileAllocateAndRead:\r
       //\r
-      // About to read beyond the EOF -- truncate it.\r
+      // Initialise ReadFileInfo structure for either getting file size, or\r
+      // reading file's recorded data.\r
       //\r
-      ReadFileInfo->FileDataSize = Length;\r
-    }\r
-\r
-    //\r
-    // Initialise data to start seeking and/or reading a file.\r
-    //\r
-    BytesLeft = ReadFileInfo->FileDataSize;\r
-    DataOffset = 0;\r
-    FilePosition = 0;\r
-    FinishedSeeking = FALSE;\r
-\r
-    break;\r
-  }\r
-\r
-  RecordingFlags = GET_FE_RECORDING_FLAGS (FileEntryData);\r
-  switch (RecordingFlags) {\r
-  case InlineData:\r
-    //\r
-    // There are no extents for this FE/EFE. All data is inline.\r
-    //\r
-    Status = GetFileEntryData (FileEntryData, Volume->FileEntrySize, &Data, &Length);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    if (ReadFileInfo->Flags == ReadFileGetFileSize) {\r
-      ReadFileInfo->ReadLength = Length;\r
-    } else if (ReadFileInfo->Flags == ReadFileAllocateAndRead) {\r
+      ReadFileInfo->ReadLength = 0;\r
+      ReadFileInfo->FileData   = NULL;\r
+      break;\r
+    case ReadFileSeekAndRead:\r
       //\r
-      // Allocate buffer for starting read data.\r
+      // About to seek a file and/or read its data.\r
       //\r
-      ReadFileInfo->FileData = AllocatePool ((UINTN) Length);\r
-      if (ReadFileInfo->FileData == NULL) {\r
-        return EFI_OUT_OF_RESOURCES;\r
+      Length = ReadFileInfo->FileSize - ReadFileInfo->FilePosition;\r
+      if (ReadFileInfo->FileDataSize > Length) {\r
+        //\r
+        // About to read beyond the EOF -- truncate it.\r
+        //\r
+        ReadFileInfo->FileDataSize = Length;\r
       }\r
 \r
       //\r
-      // Read all inline data into ReadFileInfo->FileData\r
-      //\r
-      CopyMem (ReadFileInfo->FileData, Data, (UINTN) Length);\r
-      ReadFileInfo->ReadLength = Length;\r
-    } else if (ReadFileInfo->Flags == ReadFileSeekAndRead) {\r
-      //\r
-      // If FilePosition is non-zero, seek file to FilePosition, read\r
-      // FileDataSize bytes and then updates FilePosition.\r
+      // Initialise data to start seeking and/or reading a file.\r
       //\r
-      CopyMem (\r
-        ReadFileInfo->FileData,\r
-        (VOID *)((UINT8 *)Data + ReadFileInfo->FilePosition),\r
-        (UINTN) ReadFileInfo->FileDataSize\r
-        );\r
-\r
-      ReadFileInfo->FilePosition += ReadFileInfo->FileDataSize;\r
-    } else {\r
-      ASSERT (FALSE);\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    Status = EFI_SUCCESS;\r
-    break;\r
-\r
-  case LongAdsSequence:\r
-  case ShortAdsSequence:\r
-    //\r
-    // This FE/EFE contains a run of Allocation Descriptors. Get data + size\r
-    // for start reading them out.\r
-    //\r
-    Status = GetAdsInformation (FileEntryData, Volume->FileEntrySize, &Data, &Length);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
+      BytesLeft       = ReadFileInfo->FileDataSize;\r
+      DataOffset      = 0;\r
+      FilePosition    = 0;\r
+      FinishedSeeking = FALSE;\r
 \r
-    AdOffset = 0;\r
+      break;\r
+  }\r
 \r
-    for (;;) {\r
+  RecordingFlags = GET_FE_RECORDING_FLAGS (FileEntryData);\r
+  switch (RecordingFlags) {\r
+    case InlineData:\r
       //\r
-      // Read AD.\r
+      // There are no extents for this FE/EFE. All data is inline.\r
       //\r
-      Status = GetAllocationDescriptor (\r
-        RecordingFlags,\r
-        Data,\r
-        &AdOffset,\r
-        Length,\r
-        &Ad\r
-        );\r
-      if (Status == EFI_DEVICE_ERROR) {\r
-        Status = EFI_SUCCESS;\r
-        goto Done;\r
+      Status = GetFileEntryData (FileEntryData, Volume->FileEntrySize, &Data, &Length);\r
+      if (EFI_ERROR (Status)) {\r
+        return Status;\r
       }\r
 \r
-      //\r
-      // Check if AD is an indirect AD. If so, read Allocation Extent\r
-      // Descriptor and its extents (ADs).\r
-      //\r
-      if (GET_EXTENT_FLAGS (RecordingFlags, Ad) == ExtentIsNextExtent) {\r
-        DataBak = Data;\r
-        Status = GetAedAdsData (\r
-          BlockIo,\r
-          DiskIo,\r
-          Volume,\r
-          ParentIcb,\r
-          RecordingFlags,\r
-          Ad,\r
-          &Data,\r
-          &Length\r
-          );\r
-\r
-        if (!DoFreeAed) {\r
-          DoFreeAed = TRUE;\r
-        } else {\r
-          FreePool (DataBak);\r
+      if (ReadFileInfo->Flags == ReadFileGetFileSize) {\r
+        ReadFileInfo->ReadLength = Length;\r
+      } else if (ReadFileInfo->Flags == ReadFileAllocateAndRead) {\r
+        //\r
+        // Allocate buffer for starting read data.\r
+        //\r
+        ReadFileInfo->FileData = AllocatePool ((UINTN)Length);\r
+        if (ReadFileInfo->FileData == NULL) {\r
+          return EFI_OUT_OF_RESOURCES;\r
         }\r
 \r
-        if (EFI_ERROR (Status)) {\r
-          goto Error_Get_Aed;\r
-        }\r
-        ASSERT (Data != NULL);\r
+        //\r
+        // Read all inline data into ReadFileInfo->FileData\r
+        //\r
+        CopyMem (ReadFileInfo->FileData, Data, (UINTN)Length);\r
+        ReadFileInfo->ReadLength = Length;\r
+      } else if (ReadFileInfo->Flags == ReadFileSeekAndRead) {\r
+        //\r
+        // If FilePosition is non-zero, seek file to FilePosition, read\r
+        // FileDataSize bytes and then updates FilePosition.\r
+        //\r
+        CopyMem (\r
+          ReadFileInfo->FileData,\r
+          (VOID *)((UINT8 *)Data + ReadFileInfo->FilePosition),\r
+          (UINTN)ReadFileInfo->FileDataSize\r
+          );\r
 \r
-        AdOffset = 0;\r
-        continue;\r
+        ReadFileInfo->FilePosition += ReadFileInfo->FileDataSize;\r
+      } else {\r
+        ASSERT (FALSE);\r
+        return EFI_INVALID_PARAMETER;\r
       }\r
 \r
-      ExtentLength = GET_EXTENT_LENGTH (RecordingFlags, Ad);\r
+      Status = EFI_SUCCESS;\r
+      break;\r
 \r
-      Status = GetAllocationDescriptorLsn (RecordingFlags,\r
-                                           Volume,\r
-                                           ParentIcb,\r
-                                           Ad,\r
-                                           &Lsn);\r
+    case LongAdsSequence:\r
+    case ShortAdsSequence:\r
+      //\r
+      // This FE/EFE contains a run of Allocation Descriptors. Get data + size\r
+      // for start reading them out.\r
+      //\r
+      Status = GetAdsInformation (FileEntryData, Volume->FileEntrySize, &Data, &Length);\r
       if (EFI_ERROR (Status)) {\r
-        goto Done;\r
+        return Status;\r
       }\r
 \r
-      switch (ReadFileInfo->Flags) {\r
-      case ReadFileGetFileSize:\r
-        ReadFileInfo->ReadLength += ExtentLength;\r
-        break;\r
-      case ReadFileAllocateAndRead:\r
-        //\r
-        // Increase FileData (if necessary) to read next extent.\r
-        //\r
-        Status = GrowUpBufferToNextAd (\r
-          RecordingFlags,\r
-          Ad,\r
-          &ReadFileInfo->FileData,\r
-          ReadFileInfo->ReadLength\r
-          );\r
-        if (EFI_ERROR (Status)) {\r
-          goto Error_Alloc_Buffer_To_Next_Ad;\r
-        }\r
+      AdOffset = 0;\r
 \r
+      for ( ; ;) {\r
         //\r
-        // Read extent's data into FileData.\r
+        // Read AD.\r
         //\r
-        Status = DiskIo->ReadDisk (\r
-          DiskIo,\r
-          BlockIo->Media->MediaId,\r
-          MultU64x32 (Lsn, LogicalBlockSize),\r
-          ExtentLength,\r
-          (VOID *)((UINT8 *)ReadFileInfo->FileData +\r
-                   ReadFileInfo->ReadLength)\r
-          );\r
-        if (EFI_ERROR (Status)) {\r
-          goto Error_Read_Disk_Blk;\r
+        Status = GetAllocationDescriptor (\r
+                   RecordingFlags,\r
+                   Data,\r
+                   &AdOffset,\r
+                   Length,\r
+                   &Ad\r
+                   );\r
+        if (Status == EFI_DEVICE_ERROR) {\r
+          Status = EFI_SUCCESS;\r
+          goto Done;\r
         }\r
 \r
-        ReadFileInfo->ReadLength += ExtentLength;\r
-        break;\r
-      case ReadFileSeekAndRead:\r
         //\r
-        // Seek file first before reading in its data.\r
+        // Check if AD is an indirect AD. If so, read Allocation Extent\r
+        // Descriptor and its extents (ADs).\r
         //\r
-        if (FinishedSeeking) {\r
-          Offset = 0;\r
-          goto Skip_File_Seek;\r
-        }\r
+        if (GET_EXTENT_FLAGS (RecordingFlags, Ad) == ExtentIsNextExtent) {\r
+          DataBak = Data;\r
+          Status  = GetAedAdsData (\r
+                      BlockIo,\r
+                      DiskIo,\r
+                      Volume,\r
+                      ParentIcb,\r
+                      RecordingFlags,\r
+                      Ad,\r
+                      &Data,\r
+                      &Length\r
+                      );\r
+\r
+          if (!DoFreeAed) {\r
+            DoFreeAed = TRUE;\r
+          } else {\r
+            FreePool (DataBak);\r
+          }\r
 \r
-        if (FilePosition + ExtentLength < ReadFileInfo->FilePosition) {\r
-          FilePosition += ExtentLength;\r
-          goto Skip_Ad;\r
-        }\r
+          if (EFI_ERROR (Status)) {\r
+            goto Error_Get_Aed;\r
+          }\r
 \r
-        if (FilePosition + ExtentLength > ReadFileInfo->FilePosition) {\r
-          Offset = ReadFileInfo->FilePosition - FilePosition;\r
-        } else {\r
-          Offset = 0;\r
+          ASSERT (Data != NULL);\r
+\r
+          AdOffset = 0;\r
+          continue;\r
         }\r
 \r
-        //\r
-        // Done with seeking file. Start reading its data.\r
-        //\r
-        FinishedSeeking = TRUE;\r
+        ExtentLength = GET_EXTENT_LENGTH (RecordingFlags, Ad);\r
 \r
-      Skip_File_Seek:\r
-        //\r
-        // Make sure we don't read more data than really wanted.\r
-        //\r
-        if (ExtentLength - Offset > BytesLeft) {\r
-          DataLength = BytesLeft;\r
-        } else {\r
-          DataLength = ExtentLength - Offset;\r
+        Status = GetAllocationDescriptorLsn (\r
+                   RecordingFlags,\r
+                   Volume,\r
+                   ParentIcb,\r
+                   Ad,\r
+                   &Lsn\r
+                   );\r
+        if (EFI_ERROR (Status)) {\r
+          goto Done;\r
         }\r
 \r
-        //\r
-        // Read extent's data into FileData.\r
-        //\r
-        Status = DiskIo->ReadDisk (\r
-          DiskIo,\r
-          BlockIo->Media->MediaId,\r
-          Offset + MultU64x32 (Lsn, LogicalBlockSize),\r
-          (UINTN) DataLength,\r
-          (VOID *)((UINT8 *)ReadFileInfo->FileData +\r
-                   DataOffset)\r
-          );\r
-        if (EFI_ERROR (Status)) {\r
-          goto Error_Read_Disk_Blk;\r
+        switch (ReadFileInfo->Flags) {\r
+          case ReadFileGetFileSize:\r
+            ReadFileInfo->ReadLength += ExtentLength;\r
+            break;\r
+          case ReadFileAllocateAndRead:\r
+            //\r
+            // Increase FileData (if necessary) to read next extent.\r
+            //\r
+            Status = GrowUpBufferToNextAd (\r
+                       RecordingFlags,\r
+                       Ad,\r
+                       &ReadFileInfo->FileData,\r
+                       ReadFileInfo->ReadLength\r
+                       );\r
+            if (EFI_ERROR (Status)) {\r
+              goto Error_Alloc_Buffer_To_Next_Ad;\r
+            }\r
+\r
+            //\r
+            // Read extent's data into FileData.\r
+            //\r
+            Status = DiskIo->ReadDisk (\r
+                               DiskIo,\r
+                               BlockIo->Media->MediaId,\r
+                               MultU64x32 (Lsn, LogicalBlockSize),\r
+                               ExtentLength,\r
+                               (VOID *)((UINT8 *)ReadFileInfo->FileData +\r
+                                        ReadFileInfo->ReadLength)\r
+                               );\r
+            if (EFI_ERROR (Status)) {\r
+              goto Error_Read_Disk_Blk;\r
+            }\r
+\r
+            ReadFileInfo->ReadLength += ExtentLength;\r
+            break;\r
+          case ReadFileSeekAndRead:\r
+            //\r
+            // Seek file first before reading in its data.\r
+            //\r
+            if (FinishedSeeking) {\r
+              Offset = 0;\r
+              goto Skip_File_Seek;\r
+            }\r
+\r
+            if (FilePosition + ExtentLength < ReadFileInfo->FilePosition) {\r
+              FilePosition += ExtentLength;\r
+              goto Skip_Ad;\r
+            }\r
+\r
+            if (FilePosition + ExtentLength > ReadFileInfo->FilePosition) {\r
+              Offset = ReadFileInfo->FilePosition - FilePosition;\r
+            } else {\r
+              Offset = 0;\r
+            }\r
+\r
+            //\r
+            // Done with seeking file. Start reading its data.\r
+            //\r
+            FinishedSeeking = TRUE;\r
+\r
+Skip_File_Seek:\r
+            //\r
+            // Make sure we don't read more data than really wanted.\r
+            //\r
+            if (ExtentLength - Offset > BytesLeft) {\r
+              DataLength = BytesLeft;\r
+            } else {\r
+              DataLength = ExtentLength - Offset;\r
+            }\r
+\r
+            //\r
+            // Read extent's data into FileData.\r
+            //\r
+            Status = DiskIo->ReadDisk (\r
+                               DiskIo,\r
+                               BlockIo->Media->MediaId,\r
+                               Offset + MultU64x32 (Lsn, LogicalBlockSize),\r
+                               (UINTN)DataLength,\r
+                               (VOID *)((UINT8 *)ReadFileInfo->FileData +\r
+                                        DataOffset)\r
+                               );\r
+            if (EFI_ERROR (Status)) {\r
+              goto Error_Read_Disk_Blk;\r
+            }\r
+\r
+            //\r
+            // Update current file's position.\r
+            //\r
+            DataOffset                 += DataLength;\r
+            ReadFileInfo->FilePosition += DataLength;\r
+\r
+            BytesLeft -= DataLength;\r
+            if (BytesLeft == 0) {\r
+              //\r
+              // There is no more file data to read.\r
+              //\r
+              Status = EFI_SUCCESS;\r
+              goto Done;\r
+            }\r
+\r
+            break;\r
         }\r
 \r
+Skip_Ad:\r
         //\r
-        // Update current file's position.\r
+        // Point to the next AD (extent).\r
         //\r
-        DataOffset += DataLength;\r
-        ReadFileInfo->FilePosition += DataLength;\r
-\r
-        BytesLeft -= DataLength;\r
-        if (BytesLeft == 0) {\r
-          //\r
-          // There is no more file data to read.\r
-          //\r
-          Status = EFI_SUCCESS;\r
-          goto Done;\r
-        }\r
-\r
-        break;\r
+        AdOffset += AD_LENGTH (RecordingFlags);\r
       }\r
 \r
-    Skip_Ad:\r
+      break;\r
+    case ExtendedAdsSequence:\r
+      // FIXME: Not supported. Got no volume with it, yet.\r
+      ASSERT (FALSE);\r
+      Status = EFI_UNSUPPORTED;\r
+      break;\r
+\r
+    default:\r
       //\r
-      // Point to the next AD (extent).\r
+      // A flag value reserved by the ECMA-167 standard (3rd Edition - June\r
+      // 1997); 14.6 ICB Tag; 14.6.8 Flags (RBP 18); was found.\r
       //\r
-      AdOffset += AD_LENGTH (RecordingFlags);\r
-    }\r
-\r
-    break;\r
-  case ExtendedAdsSequence:\r
-     // FIXME: Not supported. Got no volume with it, yet.\r
-    ASSERT (FALSE);\r
-    Status = EFI_UNSUPPORTED;\r
-    break;\r
-\r
-  default:\r
-    //\r
-    // A flag value reserved by the ECMA-167 standard (3rd Edition - June\r
-    // 1997); 14.6 ICB Tag; 14.6.8 Flags (RBP 18); was found.\r
-    //\r
-    Status = EFI_UNSUPPORTED;\r
-    break;\r
+      Status = EFI_UNSUPPORTED;\r
+      break;\r
   }\r
 \r
 Done:\r
@@ -1475,18 +1492,18 @@ InternalFindFile (
   ZeroMem ((VOID *)&ReadDirInfo, sizeof (UDF_READ_DIRECTORY_INFO));\r
   Found = FALSE;\r
 \r
-  for (;;) {\r
+  for ( ; ;) {\r
     Status = ReadDirectoryEntry (\r
-      BlockIo,\r
-      DiskIo,\r
-      Volume,\r
-      (Parent->FileIdentifierDesc != NULL) ?\r
-      &Parent->FileIdentifierDesc->Icb :\r
-      Icb,\r
-      Parent->FileEntry,\r
-      &ReadDirInfo,\r
-      &FileIdentifierDesc\r
-      );\r
+               BlockIo,\r
+               DiskIo,\r
+               Volume,\r
+               (Parent->FileIdentifierDesc != NULL) ?\r
+               &Parent->FileIdentifierDesc->Icb :\r
+               Icb,\r
+               Parent->FileEntry,\r
+               &ReadDirInfo,\r
+               &FileIdentifierDesc\r
+               );\r
     if (EFI_ERROR (Status)) {\r
       if (Status == EFI_DEVICE_ERROR) {\r
         Status = EFI_NOT_FOUND;\r
@@ -1494,6 +1511,7 @@ InternalFindFile (
 \r
       break;\r
     }\r
+\r
     //\r
     // After calling function ReadDirectoryEntry(), if 'FileIdentifierDesc' is\r
     // NULL, then the 'Status' must be EFI_OUT_OF_RESOURCES. Hence, if the code\r
@@ -1510,7 +1528,7 @@ InternalFindFile (
       // directory (Parent), and if FileName is either ".." or "\\", then it's\r
       // the expected FID.\r
       //\r
-      if (StrCmp (FileName, L"..") == 0 || StrCmp (FileName, L"\\") == 0) {\r
+      if ((StrCmp (FileName, L"..") == 0) || (StrCmp (FileName, L"\\") == 0)) {\r
         Found = TRUE;\r
         break;\r
       }\r
@@ -1552,12 +1570,12 @@ InternalFindFile (
     //\r
     if (StrCmp (FileName, L"\\") != 0) {\r
       Status = FindFileEntry (\r
-        BlockIo,\r
-        DiskIo,\r
-        Volume,\r
-        &FileIdentifierDesc->Icb,\r
-        &CompareFileEntry\r
-        );\r
+                 BlockIo,\r
+                 DiskIo,\r
+                 Volume,\r
+                 &FileIdentifierDesc->Icb,\r
+                 &CompareFileEntry\r
+                 );\r
       if (EFI_ERROR (Status)) {\r
         goto Error_Find_Fe;\r
       }\r
@@ -1565,8 +1583,12 @@ InternalFindFile (
       //\r
       // Make sure that both Parent's FE/EFE and found FE/EFE are not equal.\r
       //\r
-      if (CompareMem ((VOID *)Parent->FileEntry, (VOID *)CompareFileEntry,\r
-                      Volume->FileEntrySize) != 0) {\r
+      if (CompareMem (\r
+            (VOID *)Parent->FileEntry,\r
+            (VOID *)CompareFileEntry,\r
+            Volume->FileEntrySize\r
+            ) != 0)\r
+      {\r
         File->FileEntry = CompareFileEntry;\r
       } else {\r
         FreePool ((VOID *)FileIdentifierDesc);\r
@@ -1605,16 +1627,16 @@ ReadUdfVolumeInformation (
   OUT  UDF_VOLUME_INFO        *Volume\r
   )\r
 {\r
-  EFI_STATUS Status;\r
+  EFI_STATUS  Status;\r
 \r
   //\r
   // Read all necessary UDF volume information and keep it private to the driver\r
   //\r
   Status = ReadVolumeFileStructure (\r
-    BlockIo,\r
-    DiskIo,\r
-    Volume\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -1658,29 +1680,29 @@ FindRootDirectory (
   UDF_FILE_INFO  Parent;\r
 \r
   Status = FindFileEntry (\r
-    BlockIo,\r
-    DiskIo,\r
-    Volume,\r
-    &Volume->FileSetDesc.RootDirectoryIcb,\r
-    &File->FileEntry\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume,\r
+             &Volume->FileSetDesc.RootDirectoryIcb,\r
+             &File->FileEntry\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
-  Parent.FileEntry = File->FileEntry;\r
+  Parent.FileEntry          = File->FileEntry;\r
   Parent.FileIdentifierDesc = NULL;\r
 \r
   Status = FindFile (\r
-    BlockIo,\r
-    DiskIo,\r
-    Volume,\r
-    L"\\",\r
-    NULL,\r
-    &Parent,\r
-    &Volume->FileSetDesc.RootDirectoryIcb,\r
-    File\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume,\r
+             L"\\",\r
+             NULL,\r
+             &Parent,\r
+             &Volume->FileSetDesc.RootDirectoryIcb,\r
+             File\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     FreePool (File->FileEntry);\r
   }\r
@@ -1725,7 +1747,7 @@ FindFileEntry (
     return Status;\r
   }\r
 \r
-  LogicalBlockSize  = Volume->LogicalVolDesc.LogicalBlockSize;\r
+  LogicalBlockSize = Volume->LogicalVolDesc.LogicalBlockSize;\r
 \r
   ReadBuffer = AllocateZeroPool (Volume->FileEntrySize);\r
   if (ReadBuffer == NULL) {\r
@@ -1736,12 +1758,12 @@ FindFileEntry (
   // Read extent.\r
   //\r
   Status = DiskIo->ReadDisk (\r
-    DiskIo,\r
-    BlockIo->Media->MediaId,\r
-    MultU64x32 (Lsn, LogicalBlockSize),\r
-    Volume->FileEntrySize,\r
-    ReadBuffer\r
-    );\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     MultU64x32 (Lsn, LogicalBlockSize),\r
+                     Volume->FileEntrySize,\r
+                     ReadBuffer\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     goto Error_Read_Disk_Blk;\r
   }\r
@@ -1752,8 +1774,9 @@ FindFileEntry (
   // Check if the read extent contains a valid Tag Identifier for the expected\r
   // FE/EFE.\r
   //\r
-  if (DescriptorTag->TagIdentifier != UdfFileEntry &&\r
-      DescriptorTag->TagIdentifier != UdfExtendedFileEntry) {\r
+  if ((DescriptorTag->TagIdentifier != UdfFileEntry) &&\r
+      (DescriptorTag->TagIdentifier != UdfExtendedFileEntry))\r
+  {\r
     Status = EFI_VOLUME_CORRUPTED;\r
     goto Error_Invalid_Fe;\r
   }\r
@@ -1813,7 +1836,8 @@ FindFile (
     FileNamePointer = FileName;\r
     while (*FilePath != L'\0' && *FilePath != L'\\') {\r
       if ((((UINTN)FileNamePointer - (UINTN)FileName) / sizeof (CHAR16)) >=\r
-          (ARRAY_SIZE (FileName) - 1)) {\r
+          (ARRAY_SIZE (FileName) - 1))\r
+      {\r
         return EFI_NOT_FOUND;\r
       }\r
 \r
@@ -1832,13 +1856,15 @@ FindFile (
         //\r
         // See UdfOpenVolume() function.\r
         //\r
-        Status = InternalFindFile (BlockIo,\r
-                                   DiskIo,\r
-                                   Volume,\r
-                                   L"\\",\r
-                                   &PreviousFile,\r
-                                   Icb,\r
-                                   File);\r
+        Status = InternalFindFile (\r
+                   BlockIo,\r
+                   DiskIo,\r
+                   Volume,\r
+                   L"\\",\r
+                   &PreviousFile,\r
+                   Icb,\r
+                   File\r
+                   );\r
       } else {\r
         //\r
         // We've already a file pointer (Root) for the root directory. Duplicate\r
@@ -1863,13 +1889,15 @@ FindFile (
       //\r
       // No root directory. Find filename from the current directory.\r
       //\r
-      Status = InternalFindFile (BlockIo,\r
-                                 DiskIo,\r
-                                 Volume,\r
-                                 FileName,\r
-                                 &PreviousFile,\r
-                                 Icb,\r
-                                 File);\r
+      Status = InternalFindFile (\r
+                 BlockIo,\r
+                 DiskIo,\r
+                 Volume,\r
+                 FileName,\r
+                 &PreviousFile,\r
+                 Icb,\r
+                 File\r
+                 );\r
     }\r
 \r
     if (EFI_ERROR (Status)) {\r
@@ -1885,12 +1913,14 @@ FindFile (
 \r
       FileEntry = File->FileEntry;\r
 \r
-      Status = ResolveSymlink (BlockIo,\r
-                               DiskIo,\r
-                               Volume,\r
-                               &PreviousFile,\r
-                               FileEntry,\r
-                               File);\r
+      Status = ResolveSymlink (\r
+                 BlockIo,\r
+                 DiskIo,\r
+                 Volume,\r
+                 &PreviousFile,\r
+                 FileEntry,\r
+                 File\r
+                 );\r
 \r
       FreePool (FileEntry);\r
 \r
@@ -1899,13 +1929,17 @@ FindFile (
       }\r
     }\r
 \r
-    if (CompareMem ((VOID *)&PreviousFile, (VOID *)Parent,\r
-                    sizeof (UDF_FILE_INFO)) != 0) {\r
+    if (CompareMem (\r
+          (VOID *)&PreviousFile,\r
+          (VOID *)Parent,\r
+          sizeof (UDF_FILE_INFO)\r
+          ) != 0)\r
+    {\r
       CleanupFileInformation (&PreviousFile);\r
     }\r
 \r
     CopyMem ((VOID *)&PreviousFile, (VOID *)File, sizeof (UDF_FILE_INFO));\r
-    if (*FilePath != L'\0' && *FilePath == L'\\') {\r
+    if ((*FilePath != L'\0') && (*FilePath == L'\\')) {\r
       FilePath++;\r
     }\r
   }\r
@@ -1957,13 +1991,13 @@ ReadDirectoryEntry (
     ReadFileInfo.Flags = ReadFileAllocateAndRead;\r
 \r
     Status = ReadFile (\r
-      BlockIo,\r
-      DiskIo,\r
-      Volume,\r
-      ParentIcb,\r
-      FileEntryData,\r
-      &ReadFileInfo\r
-      );\r
+               BlockIo,\r
+               DiskIo,\r
+               Volume,\r
+               ParentIcb,\r
+               FileEntryData,\r
+               &ReadFileInfo\r
+               );\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
@@ -1971,7 +2005,7 @@ ReadDirectoryEntry (
     //\r
     // Fill in ReadDirInfo structure with the read directory's data information.\r
     //\r
-    ReadDirInfo->DirectoryData = ReadFileInfo.FileData;\r
+    ReadDirInfo->DirectoryData   = ReadFileInfo.FileData;\r
     ReadDirInfo->DirectoryLength = ReadFileInfo.ReadLength;\r
   }\r
 \r
@@ -1988,8 +2022,10 @@ ReadDirectoryEntry (
     //\r
     // Get FID for this entry.\r
     //\r
-    FileIdentifierDesc = GET_FID_FROM_ADS (ReadDirInfo->DirectoryData,\r
-                                           ReadDirInfo->FidOffset);\r
+    FileIdentifierDesc = GET_FID_FROM_ADS (\r
+                           ReadDirInfo->DirectoryData,\r
+                           ReadDirInfo->FidOffset\r
+                           );\r
     //\r
     // Update FidOffset to point to next FID.\r
     //\r
@@ -2031,11 +2067,11 @@ GetFileNameFromFid (
   OUT  CHAR16                          *FileName\r
   )\r
 {\r
-  UINT8  *OstaCompressed;\r
-  UINT8  CompressionId;\r
-  UINT8  Length;\r
-  UINTN  Index;\r
-  CHAR16 *FileNameBak;\r
+  UINT8   *OstaCompressed;\r
+  UINT8   CompressionId;\r
+  UINT8   Length;\r
+  UINTN   Index;\r
+  CHAR16  *FileNameBak;\r
 \r
   if (CharMax == 0) {\r
     return EFI_BUFFER_TOO_SMALL;\r
@@ -2043,9 +2079,9 @@ GetFileNameFromFid (
 \r
   OstaCompressed =\r
     (UINT8 *)(\r
-      (UINT8 *)FileIdentifierDesc->Data +\r
-      FileIdentifierDesc->LengthOfImplementationUse\r
-      );\r
+              (UINT8 *)FileIdentifierDesc->Data +\r
+              FileIdentifierDesc->LengthOfImplementationUse\r
+              );\r
 \r
   CompressionId = OstaCompressed[0];\r
   if (!IS_VALID_COMPRESSION_ID (CompressionId)) {\r
@@ -2086,6 +2122,7 @@ GetFileNameFromFid (
   if (Index > CharMax - 1) {\r
     Index = CharMax - 1;\r
   }\r
+\r
   FileNameBak[Index] = L'\0';\r
 \r
   return EFI_SUCCESS;\r
@@ -2152,135 +2189,140 @@ ResolveSymlink (
   ReadFileInfo.Flags = ReadFileAllocateAndRead;\r
 \r
   Status = ReadFile (\r
-    BlockIo,\r
-    DiskIo,\r
-    Volume,\r
-    &Parent->FileIdentifierDesc->Icb,\r
-    FileEntryData,\r
-    &ReadFileInfo\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume,\r
+             &Parent->FileIdentifierDesc->Icb,\r
+             FileEntryData,\r
+             &ReadFileInfo\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   Length = ReadFileInfo.ReadLength;\r
 \r
-  Data = (UINT8 *)ReadFileInfo.FileData;\r
+  Data    = (UINT8 *)ReadFileInfo.FileData;\r
   EndData = Data + Length;\r
 \r
   CopyMem ((VOID *)&PreviousFile, (VOID *)Parent, sizeof (UDF_FILE_INFO));\r
 \r
-  for (;;) {\r
+  for ( ; ;) {\r
     PathComp = (UDF_PATH_COMPONENT *)Data;\r
 \r
     PathCompLength = PathComp->LengthOfComponentIdentifier;\r
 \r
     switch (PathComp->ComponentType) {\r
-    case 1:\r
+      case 1:\r
       //\r
       // This Path Component specifies the root directory hierarchy subject to\r
       // agreement between the originator and recipient of the medium. Skip it.\r
       //\r
       // Fall through.\r
       //\r
-    case 2:\r
-      //\r
-      // "\\." of the current directory. Read next Path Component.\r
-      //\r
-      goto Next_Path_Component;\r
-    case 3:\r
-      //\r
-      // ".." (parent directory). Go to it.\r
-      //\r
-      CopyMem ((VOID *)FileName, L"..", 6);\r
-      break;\r
-    case 4:\r
-      //\r
-      // "." (current file). Duplicate both FE/EFE and FID of this file.\r
-      //\r
-      DuplicateFe (BlockIo, Volume, PreviousFile.FileEntry, &File->FileEntry);\r
-      if (File->FileEntry == NULL) {\r
-        Status = EFI_OUT_OF_RESOURCES;\r
-        goto Error_Find_File;\r
-      }\r
+      case 2:\r
+        //\r
+        // "\\." of the current directory. Read next Path Component.\r
+        //\r
+        goto Next_Path_Component;\r
+      case 3:\r
+        //\r
+        // ".." (parent directory). Go to it.\r
+        //\r
+        CopyMem ((VOID *)FileName, L"..", 6);\r
+        break;\r
+      case 4:\r
+        //\r
+        // "." (current file). Duplicate both FE/EFE and FID of this file.\r
+        //\r
+        DuplicateFe (BlockIo, Volume, PreviousFile.FileEntry, &File->FileEntry);\r
+        if (File->FileEntry == NULL) {\r
+          Status = EFI_OUT_OF_RESOURCES;\r
+          goto Error_Find_File;\r
+        }\r
 \r
-      DuplicateFid (PreviousFile.FileIdentifierDesc,\r
-                    &File->FileIdentifierDesc);\r
-      if (File->FileIdentifierDesc == NULL) {\r
-        FreePool (File->FileEntry);\r
-        Status = EFI_OUT_OF_RESOURCES;\r
-        goto Error_Find_File;\r
-      }\r
-      goto Next_Path_Component;\r
-    case 5:\r
-      //\r
-      // This Path Component identifies an object, either a file or a\r
-      // directory or an alias.\r
-      //\r
-      // Decode it from the compressed data in ComponentIdentifier and find\r
-      // respective path.\r
-      //\r
-      CompressionId = PathComp->ComponentIdentifier[0];\r
-      if (!IS_VALID_COMPRESSION_ID (CompressionId)) {\r
-        return EFI_VOLUME_CORRUPTED;\r
-      }\r
+        DuplicateFid (\r
+          PreviousFile.FileIdentifierDesc,\r
+          &File->FileIdentifierDesc\r
+          );\r
+        if (File->FileIdentifierDesc == NULL) {\r
+          FreePool (File->FileEntry);\r
+          Status = EFI_OUT_OF_RESOURCES;\r
+          goto Error_Find_File;\r
+        }\r
 \r
-      if ((UINTN)PathComp->ComponentIdentifier + PathCompLength > (UINTN)EndData) {\r
-        return EFI_VOLUME_CORRUPTED;\r
-      }\r
+        goto Next_Path_Component;\r
+      case 5:\r
+        //\r
+        // This Path Component identifies an object, either a file or a\r
+        // directory or an alias.\r
+        //\r
+        // Decode it from the compressed data in ComponentIdentifier and find\r
+        // respective path.\r
+        //\r
+        CompressionId = PathComp->ComponentIdentifier[0];\r
+        if (!IS_VALID_COMPRESSION_ID (CompressionId)) {\r
+          return EFI_VOLUME_CORRUPTED;\r
+        }\r
 \r
-      Char = FileName;\r
-      for (Index = 1; Index < PathCompLength; Index++) {\r
-        if (CompressionId == 16) {\r
-          *Char = *(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier +\r
-                          Index) << 8;\r
-          Index++;\r
-        } else {\r
-          if (Index > ARRAY_SIZE (FileName)) {\r
-            return EFI_UNSUPPORTED;\r
-          }\r
-          *Char = 0;\r
+        if ((UINTN)PathComp->ComponentIdentifier + PathCompLength > (UINTN)EndData) {\r
+          return EFI_VOLUME_CORRUPTED;\r
         }\r
 \r
-        if (Index < Length) {\r
-          *Char |= (CHAR16)(*(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier + Index));\r
+        Char = FileName;\r
+        for (Index = 1; Index < PathCompLength; Index++) {\r
+          if (CompressionId == 16) {\r
+            *Char = *(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier +\r
+                               Index) << 8;\r
+            Index++;\r
+          } else {\r
+            if (Index > ARRAY_SIZE (FileName)) {\r
+              return EFI_UNSUPPORTED;\r
+            }\r
+\r
+            *Char = 0;\r
+          }\r
+\r
+          if (Index < Length) {\r
+            *Char |= (CHAR16)(*(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier + Index));\r
+          }\r
+\r
+          Char++;\r
         }\r
 \r
-        Char++;\r
-      }\r
+        Index = ((UINTN)Char - (UINTN)FileName) / sizeof (CHAR16);\r
+        if (Index > ARRAY_SIZE (FileName) - 1) {\r
+          Index = ARRAY_SIZE (FileName) - 1;\r
+        }\r
 \r
-      Index = ((UINTN)Char - (UINTN)FileName) / sizeof (CHAR16);\r
-      if (Index > ARRAY_SIZE (FileName) - 1) {\r
-        Index = ARRAY_SIZE (FileName) - 1;\r
-      }\r
-      FileName[Index] = L'\0';\r
-      break;\r
-    default:\r
-      //\r
-      // According to the ECMA-167 standard (3rd Edition - June 1997), Section\r
-      // 14.16.1.1, all other values are reserved.\r
-      //\r
-      Status = EFI_VOLUME_CORRUPTED;\r
-      goto Error_Find_File;\r
+        FileName[Index] = L'\0';\r
+        break;\r
+      default:\r
+        //\r
+        // According to the ECMA-167 standard (3rd Edition - June 1997), Section\r
+        // 14.16.1.1, all other values are reserved.\r
+        //\r
+        Status = EFI_VOLUME_CORRUPTED;\r
+        goto Error_Find_File;\r
     }\r
 \r
     //\r
     // Find file from the read filename in symlink's file data.\r
     //\r
     Status = InternalFindFile (\r
-      BlockIo,\r
-      DiskIo,\r
-      Volume,\r
-      FileName,\r
-      &PreviousFile,\r
-      NULL,\r
-      File\r
-      );\r
+               BlockIo,\r
+               DiskIo,\r
+               Volume,\r
+               FileName,\r
+               &PreviousFile,\r
+               NULL,\r
+               File\r
+               );\r
     if (EFI_ERROR (Status)) {\r
       goto Error_Find_File;\r
     }\r
 \r
-  Next_Path_Component:\r
+Next_Path_Component:\r
     Data += sizeof (UDF_PATH_COMPONENT) + PathCompLength;\r
     if (Data >= EndData) {\r
       break;\r
@@ -2294,10 +2336,16 @@ ResolveSymlink (
       goto Error_Find_File;\r
     }\r
 \r
-    NotParent = (CompareMem ((VOID *)&PreviousFile, (VOID *)Parent,\r
-                 sizeof (UDF_FILE_INFO)) != 0);\r
-    NotFile   = (CompareMem ((VOID *)&PreviousFile, (VOID *)File,\r
-                 sizeof (UDF_FILE_INFO)) != 0);\r
+    NotParent = (CompareMem (\r
+                   (VOID *)&PreviousFile,\r
+                   (VOID *)Parent,\r
+                   sizeof (UDF_FILE_INFO)\r
+                   ) != 0);\r
+    NotFile = (CompareMem (\r
+                 (VOID *)&PreviousFile,\r
+                 (VOID *)File,\r
+                 sizeof (UDF_FILE_INFO)\r
+                 ) != 0);\r
 \r
     if (NotParent && NotFile) {\r
       CleanupFileInformation (&PreviousFile);\r
@@ -2323,8 +2371,12 @@ ResolveSymlink (
   return EFI_SUCCESS;\r
 \r
 Error_Find_File:\r
-  if (CompareMem ((VOID *)&PreviousFile, (VOID *)Parent,\r
-                  sizeof (UDF_FILE_INFO)) != 0) {\r
+  if (CompareMem (\r
+        (VOID *)&PreviousFile,\r
+        (VOID *)Parent,\r
+        sizeof (UDF_FILE_INFO)\r
+        ) != 0)\r
+  {\r
     CleanupFileInformation (&PreviousFile);\r
   }\r
 \r
@@ -2341,12 +2393,13 @@ Error_Find_File:
 **/\r
 VOID\r
 CleanupFileInformation (\r
-  IN UDF_FILE_INFO *File\r
+  IN UDF_FILE_INFO  *File\r
   )\r
 {\r
   if (File->FileEntry != NULL) {\r
     FreePool (File->FileEntry);\r
   }\r
+\r
   if (File->FileIdentifierDesc != NULL) {\r
     FreePool ((VOID *)File->FileIdentifierDesc);\r
   }\r
@@ -2387,13 +2440,13 @@ GetFileSize (
   ReadFileInfo.Flags = ReadFileGetFileSize;\r
 \r
   Status = ReadFile (\r
-    BlockIo,\r
-    DiskIo,\r
-    Volume,\r
-    &File->FileIdentifierDesc->Icb,\r
-    File->FileEntry,\r
-    &ReadFileInfo\r
-    );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume,\r
+             &File->FileIdentifierDesc->Icb,\r
+             File->FileEntry,\r
+             &ReadFileInfo\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -2453,10 +2506,10 @@ SetFileInfo (
   // Buffer now contains room enough to store EFI_FILE_INFO structure.\r
   // Now, fill it in with all necessary information about the file.\r
   //\r
-  FileInfo = (EFI_FILE_INFO *)Buffer;\r
-  FileInfo->Size         = FileInfoLength;\r
-  FileInfo->Attribute    &= ~EFI_FILE_VALID_ATTR;\r
-  FileInfo->Attribute    |= EFI_FILE_READ_ONLY;\r
+  FileInfo             = (EFI_FILE_INFO *)Buffer;\r
+  FileInfo->Size       = FileInfoLength;\r
+  FileInfo->Attribute &= ~EFI_FILE_VALID_ATTR;\r
+  FileInfo->Attribute |= EFI_FILE_READ_ONLY;\r
 \r
   if (IS_FID_DIRECTORY_FILE (File->FileIdentifierDesc)) {\r
     FileInfo->Attribute |= EFI_FILE_DIRECTORY;\r
@@ -2480,32 +2533,32 @@ SetFileInfo (
       FileInfo->Attribute |= EFI_FILE_SYSTEM;\r
     }\r
 \r
-    FileInfo->FileSize      = FileSize;\r
-    FileInfo->PhysicalSize  = FileSize;\r
-\r
-    FileInfo->CreateTime.Year        = FileEntry->AccessTime.Year;\r
-    FileInfo->CreateTime.Month       = FileEntry->AccessTime.Month;\r
-    FileInfo->CreateTime.Day         = FileEntry->AccessTime.Day;\r
-    FileInfo->CreateTime.Hour        = FileEntry->AccessTime.Hour;\r
-    FileInfo->CreateTime.Minute      = FileEntry->AccessTime.Minute;\r
-    FileInfo->CreateTime.Second      = FileEntry->AccessTime.Second;\r
-    FileInfo->CreateTime.Nanosecond  =\r
-                                   FileEntry->AccessTime.HundredsOfMicroseconds;\r
-\r
-    FileInfo->LastAccessTime.Year        =\r
-                                   FileEntry->AccessTime.Year;\r
-    FileInfo->LastAccessTime.Month       =\r
-                                   FileEntry->AccessTime.Month;\r
-    FileInfo->LastAccessTime.Day         =\r
-                                   FileEntry->AccessTime.Day;\r
-    FileInfo->LastAccessTime.Hour        =\r
-                                   FileEntry->AccessTime.Hour;\r
-    FileInfo->LastAccessTime.Minute      =\r
-                                   FileEntry->AccessTime.Minute;\r
-    FileInfo->LastAccessTime.Second      =\r
-                                   FileEntry->AccessTime.Second;\r
-    FileInfo->LastAccessTime.Nanosecond  =\r
-                                   FileEntry->AccessTime.HundredsOfMicroseconds;\r
+    FileInfo->FileSize     = FileSize;\r
+    FileInfo->PhysicalSize = FileSize;\r
+\r
+    FileInfo->CreateTime.Year       = FileEntry->AccessTime.Year;\r
+    FileInfo->CreateTime.Month      = FileEntry->AccessTime.Month;\r
+    FileInfo->CreateTime.Day        = FileEntry->AccessTime.Day;\r
+    FileInfo->CreateTime.Hour       = FileEntry->AccessTime.Hour;\r
+    FileInfo->CreateTime.Minute     = FileEntry->AccessTime.Minute;\r
+    FileInfo->CreateTime.Second     = FileEntry->AccessTime.Second;\r
+    FileInfo->CreateTime.Nanosecond =\r
+      FileEntry->AccessTime.HundredsOfMicroseconds;\r
+\r
+    FileInfo->LastAccessTime.Year =\r
+      FileEntry->AccessTime.Year;\r
+    FileInfo->LastAccessTime.Month =\r
+      FileEntry->AccessTime.Month;\r
+    FileInfo->LastAccessTime.Day =\r
+      FileEntry->AccessTime.Day;\r
+    FileInfo->LastAccessTime.Hour =\r
+      FileEntry->AccessTime.Hour;\r
+    FileInfo->LastAccessTime.Minute =\r
+      FileEntry->AccessTime.Minute;\r
+    FileInfo->LastAccessTime.Second =\r
+      FileEntry->AccessTime.Second;\r
+    FileInfo->LastAccessTime.Nanosecond =\r
+      FileEntry->AccessTime.HundredsOfMicroseconds;\r
   } else if (DescriptorTag->TagIdentifier == UdfExtendedFileEntry) {\r
     ExtendedFileEntry = (UDF_EXTENDED_FILE_ENTRY *)File->FileEntry;\r
 \r
@@ -2516,42 +2569,44 @@ SetFileInfo (
       FileInfo->Attribute |= EFI_FILE_SYSTEM;\r
     }\r
 \r
-    FileInfo->FileSize      = FileSize;\r
-    FileInfo->PhysicalSize  = FileSize;\r
-\r
-    FileInfo->CreateTime.Year        = ExtendedFileEntry->CreationTime.Year;\r
-    FileInfo->CreateTime.Month       = ExtendedFileEntry->CreationTime.Month;\r
-    FileInfo->CreateTime.Day         = ExtendedFileEntry->CreationTime.Day;\r
-    FileInfo->CreateTime.Hour        = ExtendedFileEntry->CreationTime.Hour;\r
-    FileInfo->CreateTime.Minute      = ExtendedFileEntry->CreationTime.Second;\r
-    FileInfo->CreateTime.Second      = ExtendedFileEntry->CreationTime.Second;\r
-    FileInfo->CreateTime.Nanosecond  =\r
-                           ExtendedFileEntry->AccessTime.HundredsOfMicroseconds;\r
-\r
-    FileInfo->LastAccessTime.Year        =\r
-                           ExtendedFileEntry->AccessTime.Year;\r
-    FileInfo->LastAccessTime.Month       =\r
-                           ExtendedFileEntry->AccessTime.Month;\r
-    FileInfo->LastAccessTime.Day         =\r
-                           ExtendedFileEntry->AccessTime.Day;\r
-    FileInfo->LastAccessTime.Hour        =\r
-                           ExtendedFileEntry->AccessTime.Hour;\r
-    FileInfo->LastAccessTime.Minute      =\r
-                           ExtendedFileEntry->AccessTime.Minute;\r
-    FileInfo->LastAccessTime.Second      =\r
-                           ExtendedFileEntry->AccessTime.Second;\r
-    FileInfo->LastAccessTime.Nanosecond  =\r
-                           ExtendedFileEntry->AccessTime.HundredsOfMicroseconds;\r
-  }\r
-\r
-  FileInfo->CreateTime.TimeZone      = EFI_UNSPECIFIED_TIMEZONE;\r
-  FileInfo->CreateTime.Daylight      = EFI_TIME_ADJUST_DAYLIGHT;\r
-  FileInfo->LastAccessTime.TimeZone  = EFI_UNSPECIFIED_TIMEZONE;\r
-  FileInfo->LastAccessTime.Daylight  = EFI_TIME_ADJUST_DAYLIGHT;\r
-\r
-  CopyMem ((VOID *)&FileInfo->ModificationTime,\r
-           (VOID *)&FileInfo->LastAccessTime,\r
-           sizeof (EFI_TIME));\r
+    FileInfo->FileSize     = FileSize;\r
+    FileInfo->PhysicalSize = FileSize;\r
+\r
+    FileInfo->CreateTime.Year       = ExtendedFileEntry->CreationTime.Year;\r
+    FileInfo->CreateTime.Month      = ExtendedFileEntry->CreationTime.Month;\r
+    FileInfo->CreateTime.Day        = ExtendedFileEntry->CreationTime.Day;\r
+    FileInfo->CreateTime.Hour       = ExtendedFileEntry->CreationTime.Hour;\r
+    FileInfo->CreateTime.Minute     = ExtendedFileEntry->CreationTime.Second;\r
+    FileInfo->CreateTime.Second     = ExtendedFileEntry->CreationTime.Second;\r
+    FileInfo->CreateTime.Nanosecond =\r
+      ExtendedFileEntry->AccessTime.HundredsOfMicroseconds;\r
+\r
+    FileInfo->LastAccessTime.Year =\r
+      ExtendedFileEntry->AccessTime.Year;\r
+    FileInfo->LastAccessTime.Month =\r
+      ExtendedFileEntry->AccessTime.Month;\r
+    FileInfo->LastAccessTime.Day =\r
+      ExtendedFileEntry->AccessTime.Day;\r
+    FileInfo->LastAccessTime.Hour =\r
+      ExtendedFileEntry->AccessTime.Hour;\r
+    FileInfo->LastAccessTime.Minute =\r
+      ExtendedFileEntry->AccessTime.Minute;\r
+    FileInfo->LastAccessTime.Second =\r
+      ExtendedFileEntry->AccessTime.Second;\r
+    FileInfo->LastAccessTime.Nanosecond =\r
+      ExtendedFileEntry->AccessTime.HundredsOfMicroseconds;\r
+  }\r
+\r
+  FileInfo->CreateTime.TimeZone     = EFI_UNSPECIFIED_TIMEZONE;\r
+  FileInfo->CreateTime.Daylight     = EFI_TIME_ADJUST_DAYLIGHT;\r
+  FileInfo->LastAccessTime.TimeZone = EFI_UNSPECIFIED_TIMEZONE;\r
+  FileInfo->LastAccessTime.Daylight = EFI_TIME_ADJUST_DAYLIGHT;\r
+\r
+  CopyMem (\r
+    (VOID *)&FileInfo->ModificationTime,\r
+    (VOID *)&FileInfo->LastAccessTime,\r
+    sizeof (EFI_TIME)\r
+    );\r
 \r
   if (FileName != NULL) {\r
     StrCpyS (FileInfo->FileName, StrLen (FileName) + 1, FileName);\r
@@ -2643,6 +2698,7 @@ GetVolumeLabel (
   if (Index > CharMax - 1) {\r
     Index = CharMax - 1;\r
   }\r
+\r
   StringBak[Index] = L'\0';\r
 \r
   return EFI_SUCCESS;\r
@@ -2697,7 +2753,8 @@ GetVolumeSize (
   ExtentAd = &LogicalVolDesc->IntegritySequenceExtent;\r
 \r
   if ((ExtentAd->ExtentLength == 0) ||\r
-      (ExtentAd->ExtentLength < sizeof (UDF_LOGICAL_VOLUME_INTEGRITY))) {\r
+      (ExtentAd->ExtentLength < sizeof (UDF_LOGICAL_VOLUME_INTEGRITY)))\r
+  {\r
     return EFI_VOLUME_CORRUPTED;\r
   }\r
 \r
@@ -2717,12 +2774,12 @@ GetVolumeSize (
   // Read disk block\r
   //\r
   Status = DiskIo->ReadDisk (\r
-    DiskIo,\r
-    BlockIo->Media->MediaId,\r
-    MultU64x32 (Lsn, LogicalBlockSize),\r
-    ExtentAd->ExtentLength,\r
-    LogicalVolInt\r
-    );\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     MultU64x32 (Lsn, LogicalBlockSize),\r
+                     ExtentAd->ExtentLength,\r
+                     LogicalVolInt\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     goto Out_Free;\r
   }\r
@@ -2739,12 +2796,13 @@ GetVolumeSize (
 \r
   if ((LogicalVolInt->NumberOfPartitions > MAX_UINT32 / sizeof (UINT32) / 2) ||\r
       (LogicalVolInt->NumberOfPartitions * sizeof (UINT32) * 2 >\r
-       ExtentAd->ExtentLength - sizeof (UDF_LOGICAL_VOLUME_INTEGRITY))) {\r
+       ExtentAd->ExtentLength - sizeof (UDF_LOGICAL_VOLUME_INTEGRITY)))\r
+  {\r
     Status = EFI_VOLUME_CORRUPTED;\r
     goto Out_Free;\r
   }\r
 \r
-  *VolumeSize = 0;\r
+  *VolumeSize    = 0;\r
   *FreeSpaceSize = 0;\r
 \r
   Length = LogicalVolInt->NumberOfPartitions;\r
@@ -2756,6 +2814,7 @@ GetVolumeSize (
     if (LsnsNo == 0xFFFFFFFFUL) {\r
       continue;\r
     }\r
+\r
     //\r
     // Accumulate free space size\r
     //\r
@@ -2763,7 +2822,7 @@ GetVolumeSize (
   }\r
 \r
   Length = LogicalVolInt->NumberOfPartitions * sizeof (UINT32) * 2;\r
-  for (; Index < Length; Index += sizeof (UINT32)) {\r
+  for ( ; Index < Length; Index += sizeof (UINT32)) {\r
     LsnsNo = *(UINT32 *)((UINT8 *)LogicalVolInt->Data + Index);\r
     //\r
     // Check if size is not specified\r
@@ -2771,6 +2830,7 @@ GetVolumeSize (
     if (LsnsNo == 0xFFFFFFFFUL) {\r
       continue;\r
     }\r
+\r
     //\r
     // Accumulate used volume space\r
     //\r
@@ -2824,26 +2884,26 @@ ReadFileData (
   EFI_STATUS          Status;\r
   UDF_READ_FILE_INFO  ReadFileInfo;\r
 \r
-  ReadFileInfo.Flags         = ReadFileSeekAndRead;\r
-  ReadFileInfo.FilePosition  = *FilePosition;\r
-  ReadFileInfo.FileData      = Buffer;\r
-  ReadFileInfo.FileDataSize  = *BufferSize;\r
-  ReadFileInfo.FileSize      = FileSize;\r
+  ReadFileInfo.Flags        = ReadFileSeekAndRead;\r
+  ReadFileInfo.FilePosition = *FilePosition;\r
+  ReadFileInfo.FileData     = Buffer;\r
+  ReadFileInfo.FileDataSize = *BufferSize;\r
+  ReadFileInfo.FileSize     = FileSize;\r
 \r
   Status = ReadFile (\r
-                 BlockIo,\r
-                 DiskIo,\r
-                 Volume,\r
-                 &File->FileIdentifierDesc->Icb,\r
-                 File->FileEntry,\r
-                 &ReadFileInfo\r
-                 );\r
+             BlockIo,\r
+             DiskIo,\r
+             Volume,\r
+             &File->FileIdentifierDesc->Icb,\r
+             File->FileEntry,\r
+             &ReadFileInfo\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
-  *BufferSize    = ReadFileInfo.FileDataSize;\r
-  *FilePosition  = ReadFileInfo.FilePosition;\r
+  *BufferSize   = ReadFileInfo.FileDataSize;\r
+  *FilePosition = ReadFileInfo.FilePosition;\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -2874,13 +2934,13 @@ SupportUdfFileSystem (
   // Open Device Path protocol on ControllerHandle\r
   //\r
   Status = gBS->OpenProtocol (\r
-    ControllerHandle,\r
-    &gEfiDevicePathProtocolGuid,\r
-    (VOID **)&DevicePath,\r
-    This->DriverBindingHandle,\r
-    ControllerHandle,\r
-    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-    );\r
+                  ControllerHandle,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  (VOID **)&DevicePath,\r
+                  This->DriverBindingHandle,\r
+                  ControllerHandle,\r
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
@@ -2891,18 +2951,20 @@ SupportUdfFileSystem (
   // Get last Device Path node\r
   //\r
   LastDevicePathNode = NULL;\r
-  DevicePathNode = DevicePath;\r
+  DevicePathNode     = DevicePath;\r
   while (!IsDevicePathEnd (DevicePathNode)) {\r
     LastDevicePathNode = DevicePathNode;\r
-    DevicePathNode = NextDevicePathNode (DevicePathNode);\r
+    DevicePathNode     = NextDevicePathNode (DevicePathNode);\r
   }\r
+\r
   //\r
   // Check if last Device Path node contains a Vendor-Defined Media Device Path\r
   // of an UDF file system.\r
   //\r
-  if (LastDevicePathNode != NULL &&\r
-      DevicePathType (LastDevicePathNode) == MEDIA_DEVICE_PATH &&\r
-      DevicePathSubType (LastDevicePathNode) == MEDIA_VENDOR_DP) {\r
+  if ((LastDevicePathNode != NULL) &&\r
+      (DevicePathType (LastDevicePathNode) == MEDIA_DEVICE_PATH) &&\r
+      (DevicePathSubType (LastDevicePathNode) == MEDIA_VENDOR_DP))\r
+  {\r
     VendorDefinedGuid = (EFI_GUID *)((UINTN)LastDevicePathNode +\r
                                      OFFSET_OF (VENDOR_DEVICE_PATH, Guid));\r
     if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) {\r
@@ -2914,11 +2976,11 @@ SupportUdfFileSystem (
   // Close Device Path protocol on ControllerHandle\r
   //\r
   gBS->CloseProtocol (\r
-    ControllerHandle,\r
-    &gEfiDevicePathProtocolGuid,\r
-    This->DriverBindingHandle,\r
-    ControllerHandle\r
-    );\r
+         ControllerHandle,\r
+         &gEfiDevicePathProtocolGuid,\r
+         This->DriverBindingHandle,\r
+         ControllerHandle\r
+         );\r
 \r
   return Status;\r
 }\r