mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/MtrrLib: use new IS_POW2() macro.
Drop MtrrLibIsPowerOfTwo function, use the new IS_POW2() macro instead. The ASSERT() removed (inside MtrrLibIsPowerOfTwo) is superfluous, another ASSERT() a few lines up in MtrrLibCalculateMtrrs() already guarantees that Length can not be zero at this point. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
parent
12d3d60f51
commit
4ca4d2b9df
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue