UefiCpuPkg/PiSmmCpuDxeSmm: fix format string

BufferPages is UINTN, so we need "%Lu" when printing it to avoid
it being truncated.  Also cast to UINT64 to make sure it works
for 32bit builds too.

Fixes: 4f441d024bee ("UefiCpuPkg/PiSmmCpuDxeSmm: fix error handling")
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Gerd Hoffmann 2023-03-27 16:02:07 +08:00 committed by mergify[bot]
parent 71210053fa
commit 54051768cd

View File

@ -880,7 +880,7 @@ PiCpuSmmEntry (
BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1));
Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
if (Buffer == NULL) {
DEBUG ((DEBUG_ERROR, "Failed to allocate %d pages.\n", BufferPages));
DEBUG ((DEBUG_ERROR, "Failed to allocate %Lu pages.\n", (UINT64)BufferPages));
CpuDeadLoop ();
return EFI_OUT_OF_RESOURCES;
}