]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c
Removed MdePkg usage of ModuleName: in file headers
[mirror_edk2.git] / MdePkg / Library / PeiMemoryLib / ScanMem16Wrapper.c
index 9ffc2cf159e758b64671a3ef7d4a245f110bda49..66a2cd40d9ba209e9ef13cef116635b9ff784c91 100644 (file)
@@ -10,8 +10,6 @@
   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
 \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
 \r
-  Module Name:  ScanMem16Wrapper.c\r
-\r
   The following BaseMemoryLib instances share the same version of this file:\r
 \r
     BaseMemoryLib\r
   The following BaseMemoryLib instances share the same version of this file:\r
 \r
     BaseMemoryLib\r
@@ -19,7 +17,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,7 +33,8 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   @param  Length      Number of bytes in Buffer to scan.\r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   @param  Length      Number of bytes in Buffer to scan.\r
@@ -52,16 +51,14 @@ ScanMem16 (
   IN UINT16      Value\r
   )\r
 {\r
   IN UINT16      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r