X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseMemoryLibOptPei%2FCompareMemWrapper.c;h=5b65a1d264cb50376237253fc8e3a2b8efa40a19;hb=2f88bd3a1296c522317f1c21377876de63de5be7;hp=61b01096b26bd4dc0869567907fd79693bb55e65;hpb=cc4e0485045285042ad088736ef278459b139d54;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c index 61b01096b2..5b65a1d264 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c @@ -1,30 +1,20 @@ /** @file CompareMem() implementation. - Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - The following BaseMemoryLib instances share the same version of this file: - + The following BaseMemoryLib instances contain the same copy of this file: BaseMemoryLib BaseMemoryLibMmx BaseMemoryLibSse2 BaseMemoryLibRepStr + BaseMemoryLibOptDxe + BaseMemoryLibOptPei PeiMemoryLib - DxeMemoryLib + UefiMemoryLib -**/ - -// -// Include common header file for this module. -// +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent +**/ #include "MemLibInternals.h" @@ -35,15 +25,15 @@ If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the value returned is the first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. - If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT(). - If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT(). - If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). - If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). + If Length > 0 and DestinationBuffer is NULL, then ASSERT(). + If Length > 0 and SourceBuffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). - @param DestinationBuffer Pointer to the destination buffer to compare. - @param SourceBuffer Pointer to the source buffer to compare. - @param Length Number of bytes to compare. + @param DestinationBuffer The pointer to the destination buffer to compare. + @param SourceBuffer The pointer to the source buffer to compare. + @param Length The number of bytes to compare. @return 0 All Length bytes of the two buffers are identical. @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first @@ -58,9 +48,10 @@ CompareMem ( IN UINTN Length ) { - if (Length == 0 || DestinationBuffer == SourceBuffer) { + if ((Length == 0) || (DestinationBuffer == SourceBuffer)) { return 0; } + ASSERT (DestinationBuffer != NULL); ASSERT (SourceBuffer != NULL); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));