diff options
author | Dandan Bi <dandan.bi@intel.com> | 2018-06-05 09:20:05 +0800 |
---|---|---|
committer | Eric Dong <eric.dong@intel.com> | 2018-06-11 16:10:22 +0800 |
commit | f75c7478280b96d191e86856c0b1c49ff711c284 (patch) | |
tree | b2f9c063d386e3006f5db0a272b6fc990c1d1344 /ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit | |
parent | a6eaba4d7f23262ab8e8502b476bdf5249a54ad4 (diff) | |
download | edk2-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/Slit')
-rw-r--r-- | ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c index a028ae541c..c38666d2b7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c @@ -63,8 +63,8 @@ ParseAcpiSlit ( )
{
UINT32 Offset;
- UINT64 i;
- UINT64 j;
+ UINT64 Count;
+ UINT64 Index;
UINT64 LocalityCount;
UINT8* LocalityPtr;
CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi
@@ -98,46 +98,46 @@ ParseAcpiSlit ( PrintFieldName (0, Buffer);
Print (L"\n");
Print (L" ");
- for (j = 0; j < LocalityCount; j++) {
- Print (L" (%3d) ", j);
+ for (Index = 0; Index < LocalityCount; Index++) {
+ Print (L" (%3d) ", Index);
}
Print (L"\n");
- for (i = 0; i < LocalityCount; i++) {
- Print (L" (%3d) ", i);
- for (j = 0; j < LocalityCount; j++) {
- Print (L" %3d ", SLIT_ELEMENT (LocalityPtr, i, j));
+ for (Count = 0; Count< LocalityCount; Count++) {
+ Print (L" (%3d) ", Count);
+ for (Index = 0; Index < LocalityCount; Index++) {
+ Print (L" %3d ", SLIT_ELEMENT (LocalityPtr, Count, Index));
}
Print (L"\n");
}
}
// Validate
- for (i = 0; i < LocalityCount; i++) {
- for (j = 0; j < LocalityCount; j++) {
+ for (Count = 0; Count < LocalityCount; Count++) {
+ for (Index = 0; Index < LocalityCount; Index++) {
// Element[x][x] must be equal to 10
- if ((i == j) && (SLIT_ELEMENT (LocalityPtr, i, j) != 10)) {
+ if ((Count == Index) && (SLIT_ELEMENT (LocalityPtr, Count,Index) != 10)) {
IncrementErrorCount ();
Print (
L"ERROR: Diagonal Element[0x%lx][0x%lx] (%3d)."
" Normalized Value is not 10\n",
- i,
- j,
- SLIT_ELEMENT (LocalityPtr, i, j)
+ Count,
+ Index,
+ SLIT_ELEMENT (LocalityPtr, Count, Index)
);
}
// Element[i][j] must be equal to Element[j][i]
- if (SLIT_ELEMENT (LocalityPtr, i, j) !=
- SLIT_ELEMENT (LocalityPtr, j, i)) {
+ if (SLIT_ELEMENT (LocalityPtr, Count, Index) !=
+ SLIT_ELEMENT (LocalityPtr, Index, Count)) {
IncrementErrorCount ();
Print (
L"ERROR: Relative distances for Element[0x%lx][0x%lx] (%3d) and \n"
"Element[0x%lx][0x%lx] (%3d) do not match.\n",
- i,
- j,
- SLIT_ELEMENT (LocalityPtr, i, j),
- j,
- i,
- SLIT_ELEMENT (LocalityPtr, j, i)
+ Count,
+ Index,
+ SLIT_ELEMENT (LocalityPtr, Count, Index),
+ Index,
+ Count,
+ SLIT_ELEMENT (LocalityPtr, Index, Count)
);
}
}
|