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>
return (MTRR_MEMORY_CACHE_TYPE)Type;\r
}\r
\r
-/**\r
- Return TRUE when the Operand is exactly power of 2.\r
-\r
- @retval TRUE Operand is exactly power of 2.\r
- @retval FALSE Operand is not power of 2.\r
-**/\r
-BOOLEAN\r
-MtrrLibIsPowerOfTwo (\r
- IN UINT64 Operand\r
- )\r
-{\r
- ASSERT (Operand != 0);\r
- return (BOOLEAN)((Operand & (Operand - 1)) == 0);\r
-}\r
-\r
/**\r
Calculate the subtractive path from vertex Start to Stop.\r
\r
break;\r
}\r
\r
- if ((Weight[M (Start, Stop)] == MAX_WEIGHT) && MtrrLibIsPowerOfTwo (Length)) {\r
+ if ((Weight[M (Start, Stop)] == MAX_WEIGHT) && IS_POW2 (Length)) {\r
if (MtrrLibGetNumberOfTypes (\r
Ranges,\r
RangeCount,\r