summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@bsdio.com>2023-03-28 11:30:59 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-29 12:47:19 +0000
commit8f8e4fa3f32e993b7f6feee259d8bd3281c0f067 (patch)
tree806ad4c0306dce925ff55a9d274907f5c5d5b91d
parente3aba976f6d588abd88027fef46999a1d3724576 (diff)
downloadedk2-8f8e4fa3f32e993b7f6feee259d8bd3281c0f067.tar.gz
edk2-8f8e4fa3f32e993b7f6feee259d8bd3281c0f067.tar.bz2
edk2-8f8e4fa3f32e993b7f6feee259d8bd3281c0f067.zip
OvmfPkg: Replace static struct initialization with ZeroMem call
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>
-rw-r--r--OvmfPkg/Library/PlatformInitLib/MemDetect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index f85a63ac51..aced8535e6 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -595,10 +595,12 @@ PlatformAddressWidthFromCpuid (
{
UINT32 RegEax, RegEbx, RegEcx, RegEdx, Max;
UINT8 PhysBits;
- CHAR8 Signature[13] = { 0 };
+ CHAR8 Signature[13];
BOOLEAN Valid = FALSE;
BOOLEAN Page1GSupport = FALSE;
+ ZeroMem (Signature, sizeof (Signature));
+
AsmCpuid (0x80000000, &RegEax, &RegEbx, &RegEcx, &RegEdx);
*(UINT32 *)(Signature + 0) = RegEbx;
*(UINT32 *)(Signature + 4) = RegEdx;