]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/XenPvBlkDxe/BlockIo.c
OvmfPkg/Xen: Fix various typos
[mirror_edk2.git] / OvmfPkg / XenPvBlkDxe / BlockIo.c
index 4f3bc53f3e8b2304e6b4c825c5354286ce17df3c..b3a527e4e3037dbb0ae75b747955ddac8af566fc 100644 (file)
@@ -6,13 +6,7 @@
 \r
   Copyright (C) 2014, Citrix Ltd.\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -58,7 +52,7 @@ EFI_BLOCK_IO_PROTOCOL  gXenPvBlkDxeBlockIo = {
 /**\r
   Read/Write BufferSize bytes from Lba into Buffer.\r
 \r
-  This function is commun to XenPvBlkDxeBlockIoReadBlocks and\r
+  This function is common to XenPvBlkDxeBlockIoReadBlocks and\r
   XenPvBlkDxeBlockIoWriteBlocks.\r
 \r
   @param  This       Indicates a pointer to the calling context.\r
@@ -95,14 +89,16 @@ XenPvBlkDxeBlockIoReadWriteBlocks (
   }\r
 \r
   if (BufferSize % Media->BlockSize != 0) {\r
-    DEBUG ((EFI_D_ERROR, "XenPvBlkDxe: Bad buffer size: 0x%X\n", BufferSize));\r
+    DEBUG ((EFI_D_ERROR, "XenPvBlkDxe: Bad buffer size: 0x%Lx\n",\r
+      (UINT64)BufferSize));\r
     return EFI_BAD_BUFFER_SIZE;\r
   }\r
 \r
   if (Lba > Media->LastBlock ||\r
       (BufferSize / Media->BlockSize) - 1 > Media->LastBlock - Lba) {\r
-    DEBUG ((EFI_D_ERROR, "XenPvBlkDxe: %a with invalid LBA: 0x%LX, size: 0x%x\n",\r
-            IsWrite ? "Write" : "Read", Lba, BufferSize));\r
+    DEBUG ((EFI_D_ERROR,\r
+      "XenPvBlkDxe: %a with invalid LBA: 0x%Lx, size: 0x%Lx\n",\r
+      IsWrite ? "Write" : "Read", Lba, (UINT64)BufferSize));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -136,7 +132,7 @@ XenPvBlkDxeBlockIoReadWriteBlocks (
   }\r
 \r
   IoData.Dev = XEN_BLOCK_FRONT_FROM_BLOCK_IO (This);\r
-  Sector = Lba * (Media->BlockSize / 512);\r
+  Sector = (UINTN)MultU64x32 (Lba, Media->BlockSize / 512);\r
 \r
   while (BufferSize > 0) {\r
     if (((UINTN)Buffer & EFI_PAGE_MASK) == 0) {\r
@@ -154,7 +150,7 @@ XenPvBlkDxeBlockIoReadWriteBlocks (
     Sector += IoData.Size / 512;\r
     Status = XenPvBlockIo (&IoData, IsWrite);\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((EFI_D_ERROR, "XenPvBlkDxe: Error durring %a operation.\n",\r
+      DEBUG ((EFI_D_ERROR, "XenPvBlkDxe: Error during %a operation.\n",\r
               IsWrite ? "write" : "read"));\r
       return Status;\r
     }\r
@@ -176,7 +172,7 @@ XenPvBlkDxeBlockIoReadWriteBlocks (
   @retval EFI_SUCCESS           The data was read correctly from the device.\r
   @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
   @retval EFI_NO_MEDIA          There is no media in the device.\r
-  @retval EFI_MEDIA_CHANGED     The MediaId does not matched the current device.\r
+  @retval EFI_MEDIA_CHANGED     The MediaId does not match the current device.\r
   @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
   @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r
                                 or the buffer is not on proper alignment.\r
@@ -210,7 +206,7 @@ XenPvBlkDxeBlockIoReadBlocks (
   @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
   @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
   @retval EFI_NO_MEDIA          There is no media in the device.\r
-  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_MEDIA_CHANGED     The MediaId does not match the current device.\r
   @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
   @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r
                                 or the buffer is not on proper alignment.\r
@@ -236,7 +232,7 @@ XenPvBlkDxeBlockIoWriteBlocks (
   @param  This              Indicates a pointer to the calling context.\r
 \r
   @retval EFI_SUCCESS       All outstanding data was written to the device\r
-  @retval EFI_DEVICE_ERROR  The device reported an error while writting back the data\r
+  @retval EFI_DEVICE_ERROR  The device reported an error while writing back the data\r
   @retval EFI_NO_MEDIA      There is no media in the device.\r
 \r
 **/\r