public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@bsdio.com>
To: devel@edk2.groups.io,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Zhiguang Liu <zhiguang.liu@intel.com>,
	Bob Feng <bob.c.feng@intel.com>,
	Yuwei Chen <yuwei.chen@intel.com>, Andrew Fish <afish@apple.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Subject: [PATCH 1/9] OvmfPkg: Replace static struct initialization with ZeroMem call
Date: Tue, 21 Mar 2023 19:30:32 -0600	[thread overview]
Message-ID: <20230322013040.3322865-2-rebecca@bsdio.com> (raw)
In-Reply-To: <20230322013040.3322865-1-rebecca@bsdio.com>

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>
---
 OvmfPkg/Library/PlatformInitLib/MemDetect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index 38cece9173e8..0bcdfb83721f 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -608,10 +608,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;
-- 
2.34.1


  reply	other threads:[~2023-03-22  1:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  1:30 [PATCH 0/9] BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete CLANG35,CLANG38 and update CLANGDWARF, delete VS 2008-2013, EBC Rebecca Cran
2023-03-22  1:30 ` Rebecca Cran [this message]
2023-03-22  5:55   ` [PATCH 1/9] OvmfPkg: Replace static struct initialization with ZeroMem call Gerd Hoffmann
2023-03-22  1:30 ` [PATCH 2/9] CryptoPkg: Add CLANGDWARF and remove CLANG35 and CLANG38 compiler flags Rebecca Cran
2023-03-22  1:30 ` [PATCH 3/9] BaseTools: Update CLANGDWARF toolchain and remove CLANG35 and CLANG38 Rebecca Cran
2023-03-22  4:57   ` [edk2-devel] " Guo, Gua
2023-03-22 13:10     ` Rebecca Cran
2023-03-22 22:07       ` Guo, Gua
2023-03-22 22:23         ` Rebecca Cran
2023-03-22 22:46           ` Guo, Gua
2023-03-27 22:15             ` Rebecca Cran
2023-03-22 11:49   ` Ard Biesheuvel
2023-03-22 12:28     ` [edk2-devel] " Rebecca Cran
2023-03-22 12:32       ` Ard Biesheuvel
2023-03-22 13:03         ` Gerd Hoffmann
2023-03-22 13:05           ` Ard Biesheuvel
2023-03-23  1:30     ` Rebecca Cran
2023-03-23  9:04       ` Ard Biesheuvel
2023-03-23 13:14         ` Ard Biesheuvel
2023-03-22  1:30 ` [PATCH 4/9] BaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions Rebecca Cran
2023-03-22  1:30 ` [PATCH 5/9] BaseTools: Remove VS2008-VS2013 remnants Rebecca Cran
2023-03-22  1:30 ` [PATCH 6/9] MdePkg: " Rebecca Cran
2023-03-22  1:30 ` [PATCH 7/9] edksetup.bat: " Rebecca Cran
2023-03-22  1:30 ` [PATCH 8/9] BaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs Rebecca Cran
2023-03-22  1:30 ` [PATCH 9/9] BaseTools: Remove EBC (EFI Byte Code) compiler definitions Rebecca Cran
2023-03-22  9:04 ` [PATCH 0/9] BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete CLANG35,CLANG38 and update CLANGDWARF, delete VS 2008-2013, EBC Ard Biesheuvel
2023-03-22 16:37 ` [edk2-devel] " Oliver Smith-Denny
2023-03-23  1:05   ` 回复: " gaoliming
2023-03-23  1:10     ` Rebecca Cran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230322013040.3322865-2-rebecca@bsdio.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox