Re: [edk2-devel] [PATCH 1/9] OvmfPkg: Replace static struct initialization with ZeroMem call

2023-03-21 Thread Gerd Hoffmann
On Tue, Mar 21, 2023 at 07:30:32PM -0600, Rebecca Cran wrote:
> 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 

Reviewed-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101556): https://edk2.groups.io/g/devel/message/101556
Mute This Topic: https://groups.io/mt/97769542/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/9] OvmfPkg: Replace static struct initialization with ZeroMem call

2023-03-21 Thread Rebecca Cran
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 
---
 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;
   UINT8PhysBits;
-  CHAR8Signature[13] = { 0 };
+  CHAR8Signature[13];
   BOOLEAN  Valid = FALSE;
   BOOLEAN  Page1GSupport = FALSE;
 
+  ZeroMem (Signature, sizeof (Signature));
+
   AsmCpuid (0x8000, , , , );
   *(UINT32 *)(Signature + 0) = RegEbx;
   *(UINT32 *)(Signature + 4) = RegEdx;
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101530): https://edk2.groups.io/g/devel/message/101530
Mute This Topic: https://groups.io/mt/97769542/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-