diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c index a66357e305..22ec8d2a48 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -1273,21 +1273,6 @@ MtrrLibLowestType ( return (MTRR_MEMORY_CACHE_TYPE)Type; } -/** - Return TRUE when the Operand is exactly power of 2. - - @retval TRUE Operand is exactly power of 2. - @retval FALSE Operand is not power of 2. -**/ -BOOLEAN -MtrrLibIsPowerOfTwo ( - IN UINT64 Operand - ) -{ - ASSERT (Operand != 0); - return (BOOLEAN)((Operand & (Operand - 1)) == 0); -} - /** Calculate the subtractive path from vertex Start to Stop. @@ -1658,7 +1643,7 @@ MtrrLibCalculateMtrrs ( break; } - if ((Weight[M (Start, Stop)] == MAX_WEIGHT) && MtrrLibIsPowerOfTwo (Length)) { + if ((Weight[M (Start, Stop)] == MAX_WEIGHT) && IS_POW2 (Length)) { if (MtrrLibGetNumberOfTypes ( Ranges, RangeCount,