Re: [edk2-devel] [PATCH v1 13/19] DynamicTablesPkg: IORT: Fix uninitialized memory usage

2020-03-27 Thread Alexei Fedorov
Reviewed by: Alexei Fedorov 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56487): https://edk2.groups.io/g/devel/message/56487
Mute This Topic: https://groups.io/mt/32999780/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v1 13/19] DynamicTablesPkg: IORT: Fix uninitialized memory usage

2019-08-23 Thread Sami Mujawar
On enabling the /analyse option the VS2017 compiler
reports: warning C6001: Using uninitialized memory.

This warning is reported as some variables that were
being logged were uninitialised. To fix this, moved
the logging code after the variables being logged are
initialised.

Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 96 
++--
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
bd71220ca19679792de2bb6d88eed8d1913a7600..65d006c89e668c8b2b8a14326cddf1b69979597f
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -1738,6 +1738,14 @@ BuildIortTable (
   goto error_handler;
 }
 TableSize += NodeSize;
+
+DEBUG ((
+  DEBUG_INFO,
+  " ItsGroupNodeCount = %d\n" \
+  " ItsGroupOffset = %d\n",
+  ItsGroupNodeCount,
+  ItsGroupOffset
+  ));
   }
 
   // Named Component Nodes
@@ -1760,6 +1768,14 @@ BuildIortTable (
   goto error_handler;
 }
 TableSize += NodeSize;
+
+DEBUG ((
+  DEBUG_INFO,
+  " NamedComponentNodeCount = %d\n" \
+  " NamedComponentOffset = %d\n",
+  NamedComponentNodeCount,
+  NamedComponentOffset
+  ));
   }
 
   // Root Complex Nodes
@@ -1782,6 +1798,14 @@ BuildIortTable (
   goto error_handler;
 }
 TableSize += NodeSize;
+
+DEBUG ((
+  DEBUG_INFO,
+  " RootComplexNodeCount = %d\n" \
+  " RootComplexOffset = %d\n",
+  RootComplexNodeCount,
+  RootComplexOffset
+  ));
   }
 
   // SMMUv1/SMMUv2 Nodes
@@ -1804,6 +1828,14 @@ BuildIortTable (
   goto error_handler;
 }
 TableSize += NodeSize;
+
+DEBUG ((
+  DEBUG_INFO,
+  " SmmuV1V2NodeCount = %d\n" \
+  " SmmuV1V2Offset = %d\n",
+  SmmuV1V2NodeCount,
+  SmmuV1V2Offset
+  ));
   }
 
   // SMMUv3 Nodes
@@ -1826,6 +1858,14 @@ BuildIortTable (
   goto error_handler;
 }
 TableSize += NodeSize;
+
+DEBUG ((
+  DEBUG_INFO,
+  " SmmuV3NodeCount = %d\n" \
+  " SmmuV3Offset = %d\n",
+  SmmuV3NodeCount,
+  SmmuV3Offset
+  ));
   }
 
   // PMCG Nodes
@@ -1848,6 +1888,14 @@ BuildIortTable (
   goto error_handler;
 }
 TableSize += NodeSize;
+
+DEBUG ((
+  DEBUG_INFO,
+  " PmcgNodeCount = %d\n" \
+  " PmcgOffset = %d\n",
+  PmcgNodeCount,
+  PmcgOffset
+  ));
   }
 
   DEBUG ((
@@ -1859,54 +1907,6 @@ BuildIortTable (
 TableSize
 ));
 
-  DEBUG ((
-DEBUG_INFO,
-" ItsGroupNodeCount = %d\n" \
-" ItsGroupOffset = %d\n",
-ItsGroupNodeCount,
-ItsGroupOffset
-));
-
-  DEBUG ((
-DEBUG_INFO,
-" NamedComponentNodeCount = %d\n" \
-" NamedComponentOffset = %d\n",
-NamedComponentNodeCount,
-NamedComponentOffset
-));
-
-  DEBUG ((
-DEBUG_INFO,
-" RootComplexNodeCount = %d\n" \
-" RootComplexOffset = %d\n",
-RootComplexNodeCount,
-RootComplexOffset
-));
-
-  DEBUG ((
-DEBUG_INFO,
-" SmmuV1V2NodeCount = %d\n" \
-" SmmuV1V2Offset = %d\n",
-SmmuV1V2NodeCount,
-SmmuV1V2Offset
-));
-
-  DEBUG ((
-DEBUG_INFO,
-" SmmuV3NodeCount = %d\n" \
-" SmmuV3Offset = %d\n",
-SmmuV3NodeCount,
-SmmuV3Offset
-));
-
-  DEBUG ((
-DEBUG_INFO,
-" PmcgNodeCount = %d\n" \
-" PmcgOffset = %d\n",
-PmcgNodeCount,
-PmcgOffset
-));
-
   if (TableSize > MAX_UINT32) {
 Status = EFI_INVALID_PARAMETER;
 DEBUG ((
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46264): https://edk2.groups.io/g/devel/message/46264
Mute This Topic: https://groups.io/mt/32999780/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-