]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
MdeModulePkg/Udf: Refine function description comments
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / Udf.c
index 3174ab2b4bdbdf68b8545008cc2bc59182e81d9a..c566bfc594d7ced79abd6703b6a86769b7fccb23 100644 (file)
@@ -40,6 +40,18 @@ UDF_DEVICE_PATH gUdfDevicePath = {
   }\r
 };\r
 \r
+/**\r
+  Find the anchor volume descriptor pointer.\r
+\r
+  @param[in]  BlockIo             BlockIo interface.\r
+  @param[in]  DiskIo              DiskIo interface.\r
+  @param[out] AnchorPoint         Anchor volume descriptor pointer.\r
+\r
+  @retval EFI_SUCCESS             Anchor volume descriptor pointer found.\r
+  @retval EFI_VOLUME_CORRUPTED    The file system structures are corrupted.\r
+  @retval other                   Anchor volume descriptor pointer not found.\r
+\r
+**/\r
 EFI_STATUS\r
 FindAnchorVolumeDescriptorPointer (\r
   IN   EFI_BLOCK_IO_PROTOCOL                 *BlockIo,\r
@@ -243,6 +255,7 @@ PartitionInstallUdfChildHandles (
   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath\r
   )\r
 {\r
+  UINT32                       RemainderByMediaBlockSize;\r
   EFI_STATUS                   Status;\r
   EFI_BLOCK_IO_MEDIA           *Media;\r
   EFI_DEVICE_PATH_PROTOCOL     *DevicePathNode;\r
@@ -255,8 +268,12 @@ PartitionInstallUdfChildHandles (
   //\r
   // Check if UDF logical block size is multiple of underlying device block size\r
   //\r
-  if ((UDF_LOGICAL_SECTOR_SIZE % Media->BlockSize) != 0 ||\r
-      Media->BlockSize > UDF_LOGICAL_SECTOR_SIZE) {\r
+  DivU64x32Remainder (\r
+    UDF_LOGICAL_SECTOR_SIZE,   // Dividend\r
+    Media->BlockSize,          // Divisor\r
+    &RemainderByMediaBlockSize // Remainder\r
+    );\r
+  if (RemainderByMediaBlockSize != 0) {\r
     return EFI_NOT_FOUND;\r
   }\r
 \r