From c73fce3d1280423212ed9c43bba17ef90363c354 Mon Sep 17 00:00:00 2001 From: "Zeng, Star" Date: Tue, 4 Feb 2020 15:02:04 +0800 Subject: UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier 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 Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Star Zeng Reviewed-by: Laszlo Ersek Reviewed-by: Eric Dong --- .../RegisterCpuFeaturesLib/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 cdee6d92ab..5c673fa8cf 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -504,8 +504,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, @@ -516,8 +516,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, @@ -527,9 +527,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, @@ -539,9 +539,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, @@ -552,8 +552,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; -- cgit v1.2.3