]> xenbits.xensource.com Git - ovmf.git/commitdiff
OvmfPkg: Replace static struct initialization with ZeroMem call
authorRebecca Cran <rebecca@bsdio.com>
Tue, 28 Mar 2023 17:30:59 +0000 (11:30 -0600)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 29 Mar 2023 12:47:19 +0000 (12:47 +0000)
Replace the static struct initialization with a call to ZeroMem to avoid
generating a call to memset in certain build configurations.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
OvmfPkg/Library/PlatformInitLib/MemDetect.c

index f85a63ac51307a2f7b59e314f7885dba78231663..aced8535e6d1314d712ada0d185d488bc4f1b981 100644 (file)
@@ -595,10 +595,12 @@ PlatformAddressWidthFromCpuid (
 {\r
   UINT32   RegEax, RegEbx, RegEcx, RegEdx, Max;\r
   UINT8    PhysBits;\r
-  CHAR8    Signature[13] = { 0 };\r
+  CHAR8    Signature[13];\r
   BOOLEAN  Valid         = FALSE;\r
   BOOLEAN  Page1GSupport = FALSE;\r
 \r
+  ZeroMem (Signature, sizeof (Signature));\r
+\r
   AsmCpuid (0x80000000, &RegEax, &RegEbx, &RegEcx, &RegEdx);\r
   *(UINT32 *)(Signature + 0) = RegEbx;\r
   *(UINT32 *)(Signature + 4) = RegEdx;\r