public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Star Zeng <star.zeng@intel.com>, devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [PATCH V2] UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier
Date: Tue, 4 Feb 2020 12:52:53 +0100	[thread overview]
Message-ID: <9bd38312-639d-ecd0-fa11-fe636c7880e3@redhat.com> (raw)
In-Reply-To: <20200204070204.41260-1-star.zeng@intel.com>

On 02/04/20 08:02, Star Zeng wrote:
> Match data type and format specifier for printing.
> 1. Type cast ProcessorNumber and FeatureIndex to UINT32
>   as %d only expects a UINT32.
> 2. Use %08x instead of %08lx for CacheControl to print Index
>   as it is UINT32 type.
> 3. Use %016lx instead of %08lx for MemoryMapped to print
>   (Index | LShiftU64 (HighIndex, 32)) as it is UINT64 type.
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  .../CpuFeaturesInitialize.c                   | 24 +++++++++----------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> index 0a4fcff033a3..fc96fb4372cf 100644
> --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> @@ -430,8 +430,8 @@ DumpRegisterTableOnProcessor (
>        DEBUG ((
>          DebugPrintErrorLevel,
>          "Processor: %04d: Index %04d, MSR  : %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",
> -        ProcessorNumber,
> -        FeatureIndex,
> +        (UINT32) ProcessorNumber,
> +        (UINT32) FeatureIndex,
>          RegisterTableEntry->Index,
>          RegisterTableEntry->ValidBitStart,
>          RegisterTableEntry->ValidBitLength,
> @@ -442,8 +442,8 @@ DumpRegisterTableOnProcessor (
>        DEBUG ((
>          DebugPrintErrorLevel,
>          "Processor: %04d: Index %04d, CR   : %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",
> -        ProcessorNumber,
> -        FeatureIndex,
> +        (UINT32) ProcessorNumber,
> +        (UINT32) FeatureIndex,
>          RegisterTableEntry->Index,
>          RegisterTableEntry->ValidBitStart,
>          RegisterTableEntry->ValidBitLength,
> @@ -453,9 +453,9 @@ DumpRegisterTableOnProcessor (
>      case MemoryMapped:
>        DEBUG ((
>          DebugPrintErrorLevel,
> -        "Processor: %04d: Index %04d, MMIO : %08lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",
> -        ProcessorNumber,
> -        FeatureIndex,
> +        "Processor: %04d: Index %04d, MMIO : %016lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",
> +        (UINT32) ProcessorNumber,
> +        (UINT32) FeatureIndex,
>          RegisterTableEntry->Index | LShiftU64 (RegisterTableEntry->HighIndex, 32),
>          RegisterTableEntry->ValidBitStart,
>          RegisterTableEntry->ValidBitLength,
> @@ -465,9 +465,9 @@ DumpRegisterTableOnProcessor (
>      case CacheControl:
>        DEBUG ((
>          DebugPrintErrorLevel,
> -        "Processor: %04d: Index %04d, CACHE: %08lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",
> -        ProcessorNumber,
> -        FeatureIndex,
> +        "Processor: %04d: Index %04d, CACHE: %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",
> +        (UINT32) ProcessorNumber,
> +        (UINT32) FeatureIndex,
>          RegisterTableEntry->Index,
>          RegisterTableEntry->ValidBitStart,
>          RegisterTableEntry->ValidBitLength,
> @@ -478,8 +478,8 @@ DumpRegisterTableOnProcessor (
>        DEBUG ((
>          DebugPrintErrorLevel,
>          "Processor: %04d: Index %04d, SEMAP: %s\r\n",
> -        ProcessorNumber,
> -        FeatureIndex,
> +        (UINT32) ProcessorNumber,
> +        (UINT32) FeatureIndex,
>          mDependTypeStr[MIN ((UINT32)RegisterTableEntry->Value, InvalidDepType)]
>          ));
>        break;
> 

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

Thanks!
Laszlo


  reply	other threads:[~2020-02-04 11:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  7:02 [PATCH V2] UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier Zeng, Star
2020-02-04 11:52 ` Laszlo Ersek [this message]
2020-02-05  2:43 ` [edk2-devel] " Dong, Eric
2020-02-18  1:26   ` Zeng, Star

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=9bd38312-639d-ecd0-fa11-fe636c7880e3@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