public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg: Cast UINT32 to UINT8 conversion in ReportCpuHobLib
@ 2021-05-19  4:15 Michael Kubacki
  2021-05-20  4:24 ` Ni, Ray
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Kubacki @ 2021-05-19  4:15 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Rangasai V Chaganty, SofiaX Chuang

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3404

Commit d3c10d3 introduced a build error in ReportCpuHobLib.c:

IntelSiliconPkg\Library\ReportCpuHobLib\ReportCpuHobLib.c(30):
  error C2220: warning treated as error - no 'object' file generated
IntelSiliconPkg\Library\ReportCpuHobLib\ReportCpuHobLib.c(30):
  warning C4244: '=': conversion from 'UINT32' to 'UINT8',
  possible loss of data

This commit explicitly cast the assignment to fix the build error.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: SofiaX Chuang <sofiax.chuang@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
index 3f67b477d25a..56d63a35edcb 100644
--- a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
+++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
@@ -27,7 +27,7 @@ ReportCpuHob (
   AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL, NULL);
   if (AddressSizeEax.Uint32 >= CPUID_VIR_PHY_ADDRESS_SIZE) {
     AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL, NULL);
-    PhysicalAddressBits = AddressSizeEax.Bits.PhysicalAddressBits;
+    PhysicalAddressBits = (UINT8)AddressSizeEax.Bits.PhysicalAddressBits;
   } else {
     PhysicalAddressBits = 36;
   }
-- 
2.28.0.windows.1


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

end of thread, other threads:[~2021-05-20  4:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19  4:15 [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg: Cast UINT32 to UINT8 conversion in ReportCpuHobLib Michael Kubacki
2021-05-20  4:24 ` Ni, Ray

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