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>
This commit is contained in:
Dandan Bi
2018-06-05 09:20:05 +08:00
committed by Eric Dong
parent a6eaba4d7f
commit f75c747828
14 changed files with 178 additions and 117 deletions

View File

@ -21,6 +21,15 @@ STATIC UINT32 gIndent;
STATIC UINT32 mTableErrorCount;
STATIC UINT32 mTableWarningCount;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/**
An ACPI_PARSER array describing the ACPI header.
**/
STATIC CONST ACPI_PARSER AcpiHeaderParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo)
};
/**
This function resets the ACPI table error counter to Zero.
**/
@ -114,10 +123,13 @@ VerifyChecksum (
IN UINT32 Length
)
{
UINTN ByteCount = 0;
UINT8 Checksum = 0;
UINTN ByteCount;
UINT8 Checksum;
UINTN OriginalAttribute;
ByteCount = 0;
Checksum = 0;
while (ByteCount < Length) {
Checksum += *(Ptr++);
ByteCount++;
@ -166,11 +178,14 @@ DumpRaw (
IN UINT32 Length
)
{
UINTN ByteCount = 0;
UINTN ByteCount;
UINTN PartLineChars;
UINTN AsciiBufferIndex = 0;
UINTN AsciiBufferIndex;
CHAR8 AsciiBuffer[17];
ByteCount = 0;
AsciiBufferIndex = 0;
Print (L"Address : 0x%p\n", Ptr);
Print (L"Length : %d\n", Length);
@ -277,7 +292,10 @@ DumpUint64 (
// Some fields are not aligned and this causes alignment faults
// on ARM platforms if the compiler generates LDRD instructions.
// Perform word access so that LDRD instructions are not generated.
UINT64 Val = *(UINT32*)(Ptr + sizeof (UINT32));
UINT64 Val;
Val = *(UINT32*)(Ptr + sizeof (UINT32));
Val <<= 32;
Val |= *(UINT32*)Ptr;
@ -456,13 +474,16 @@ ParseAcpi (
)
{
UINT32 Index;
UINT32 Offset = 0;
UINT32 Offset;
BOOLEAN HighLight;
Offset = 0;
// Increment the Indent
gIndent += Indent;
if (Trace && (AsciiName != NULL)){
BOOLEAN HighLight = GetColourHighlighting ();
HighLight = GetColourHighlighting ();
UINTN OriginalAttribute;
if (HighLight) {
@ -620,11 +641,6 @@ DumpAcpiHeader (
IN UINT8* Ptr
)
{
ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
ACPI_PARSER AcpiHeaderParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo)
};
return ParseAcpi (
TRUE,
0,
@ -658,10 +674,6 @@ ParseAcpiHeader (
)
{
UINT32 BytesParsed;
ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
ACPI_PARSER AcpiHeaderParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo)
};
BytesParsed = ParseAcpi (
FALSE,