public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: fix format string
@ 2023-03-27  8:02 Gerd Hoffmann
  2023-03-27  9:31 ` Laszlo Ersek
  2023-03-27 10:42 ` Ni, Ray
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2023-03-27  8:02 UTC (permalink / raw)
  To: devel
  Cc: Gerd Hoffmann, Eric Dong, Rahul Kumar, Oliver Steffen,
	Pawel Polawski, Ray Ni, Laszlo Ersek

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>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
index cf69161caa4b..c0e368ea9475 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
@@ -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;
     }
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-27 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27  8:02 [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: fix format string Gerd Hoffmann
2023-03-27  9:31 ` Laszlo Ersek
2023-03-27 10:42 ` Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox