public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>,
	Rahul Kumar <rahul1.kumar@intel.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Pawel Polawski <ppolawsk@redhat.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: fix format string
Date: Mon, 27 Mar 2023 11:31:07 +0200	[thread overview]
Message-ID: <36223265-e4a7-30ab-f958-de908f86748d@redhat.com> (raw)
In-Reply-To: <20230327080207.33524-1-kraxel@redhat.com>

On 3/27/23 10:02, Gerd Hoffmann wrote:
> 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;
>      }

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


  reply	other threads:[~2023-03-27  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27  8:02 [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: fix format string Gerd Hoffmann
2023-03-27  9:31 ` Laszlo Ersek [this message]
2023-03-27 10:42 ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36223265-e4a7-30ab-f958-de908f86748d@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox