From 8ff68cd5e4c91c97f36ac0f44d9f2b4ea12b5e0d Mon Sep 17 00:00:00 2001 From: Krzysztof Koch Date: Thu, 18 Jul 2019 18:05:02 -0700 Subject: [PATCH] ShellPkg: acpiview: DBG2: Remove redundant forward declarations Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Alexei Fedorov Reviewed-by: Zhichao Gao --- .../Parsers/Dbg2/Dbg2Parser.c | 62 +++++-------------- 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c index 8de5ebf747..1efcbd40f8 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c @@ -27,7 +27,7 @@ STATIC CONST UINT16* AddrSizeOffset; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; /** - This function Validates the NameSpace string length. + This function validates the NameSpace string length. @param [in] Ptr Pointer to the start of the buffer. @param [in] Context Pointer to context specific information e.g. this @@ -37,24 +37,23 @@ STATIC VOID EFIAPI ValidateNameSpaceStrLen ( - IN UINT8* Ptr, - IN VOID* Context - ); + IN UINT8* Ptr, + IN VOID* Context + ) +{ + UINT16 NameSpaceStrLen; -/** - This function parses the debug device information structure. + NameSpaceStrLen = *(UINT16*)Ptr; - @param [in] Ptr Pointer to the start of the buffer. - @param [out] Length Pointer in which the length of the debug - device information is returned. -**/ -STATIC -VOID -EFIAPI -DumpDbgDeviceInfo ( - IN UINT8* Ptr, - OUT UINT32* Length - ); + if (NameSpaceStrLen < 2) { + IncrementErrorCount (); + Print ( + L"\nERROR: NamespaceString Length = %d. If no Namespace device exists, " \ + L"NamespaceString[] must contain a period '.'", + NameSpaceStrLen + ); + } +} /// An ACPI_PARSER array describing the ACPI DBG2 table. STATIC CONST ACPI_PARSER Dbg2Parser[] = { @@ -91,35 +90,6 @@ STATIC CONST ACPI_PARSER DbgDevInfoParser[] = { (VOID**)&AddrSizeOffset, NULL, NULL} }; -/** - This function validates the NameSpace string length. - - @param [in] Ptr Pointer to the start of the buffer. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateNameSpaceStrLen ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - UINT16 NameSpaceStrLen; - - NameSpaceStrLen = *(UINT16*)Ptr; - - if (NameSpaceStrLen < 2) { - IncrementErrorCount (); - Print ( - L"\nERROR: NamespaceString Length = %d. If no Namespace device exists,\n" - L" then NamespaceString[] must contain a period '.'", - NameSpaceStrLen - ); - } -} - /** This function parses the debug device information structure.