Hello Star,

On 02/03/20 08:06, Star Zeng wrote:
> Instead of %08lx, use %08x to print CacheControl Index
> as it is UINT32 type.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Ray Ni <ray...@intel.com>
> Cc: Laszlo Ersek <ler...@redhat.com>
> Signed-off-by: Star Zeng <star.z...@intel.com>
> ---
>  .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c      | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git 
> a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
> b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> index 0a4fcff033a3..1a02809b0e7c 100644
> --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> @@ -465,7 +465,7 @@ DumpRegisterTableOnProcessor (
>      case CacheControl:
>        DEBUG ((
>          DebugPrintErrorLevel,
> -        "Processor: %04d: Index %04d, CACHE: %08lx, Bit Start: %02d, Bit 
> Length: %02d, Value: %016lx\r\n",
> +        "Processor: %04d: Index %04d, CACHE: %08x, Bit Start: %02d, Bit 
> Length: %02d, Value: %016lx\r\n",
>          ProcessorNumber,
>          FeatureIndex,
>          RegisterTableEntry->Index,
> 

if you are already touching this DEBUG invocation, can you please fix
the rest of the issues with the format string?

- ProcessorNumber is UINTN. If we know for sure it can be represented in
a UINT32, then it should be cast to UINT32 explicitly, and logged with
"%04u". (Otherwise, UINTN needs to be cast to UINT64, and logged with
%lu or %lx.)

- Ditto for FeatureIndex.

The rest of the format specifications (including the now-fixed
CPU_REGISTER_TABLE_ENTRY.Index) are OK.

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53649): https://edk2.groups.io/g/devel/message/53649
Mute This Topic: https://groups.io/mt/70940928/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to