summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2018-06-05 09:20:05 +0800
committerEric Dong <eric.dong@intel.com>2018-06-11 16:10:22 +0800
commitf75c7478280b96d191e86856c0b1c49ff711c284 (patch)
treeb2f9c063d386e3006f5db0a272b6fc990c1d1344 /ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
parenta6eaba4d7f23262ab8e8502b476bdf5249a54ad4 (diff)
downloadedk2-f75c7478280b96d191e86856c0b1c49ff711c284.tar.gz
edk2-f75c7478280b96d191e86856c0b1c49ff711c284.tar.bz2
edk2-f75c7478280b96d191e86856c0b1c49ff711c284.zip
ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues
1. Separate variable definition and initialization. 2. Make the variable naming following Edk2 rule. V2: Remove the updates of guard macros in header files. Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Evan Lloyd <evan.lloyd@arm.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
index fbe943d898..043277aabf 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
@@ -177,7 +177,10 @@ DumpSratApicProximity (
IN UINT8* Ptr
)
{
- UINT32 ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);
+ UINT32 ProximityDomain;
+
+ ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);
+
Print (Format, ProximityDomain);
}
@@ -210,13 +213,19 @@ ParseAcpiSrat (
{
UINT32 Offset;
UINT8* ResourcePtr;
- UINT32 GicCAffinityIndex = 0;
- UINT32 GicITSAffinityIndex = 0;
- UINT32 MemoryAffinityIndex = 0;
- UINT32 ApicSapicAffinityIndex = 0;
- UINT32 X2ApicAffinityIndex = 0;
+ UINT32 GicCAffinityIndex;
+ UINT32 GicITSAffinityIndex;
+ UINT32 MemoryAffinityIndex;
+ UINT32 ApicSapicAffinityIndex;
+ UINT32 X2ApicAffinityIndex;
CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi
+ GicCAffinityIndex = 0;
+ GicITSAffinityIndex = 0;
+ MemoryAffinityIndex = 0;
+ ApicSapicAffinityIndex = 0;
+ X2ApicAffinityIndex = 0;
+
if (!Trace) {
return;
}