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 <krzysztof.k...@arm.com> --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/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 8de5ebf74775bab8e765849cba6ef4eb6f659a5a..1efcbd40f86efdabed2152540a415db8a950fb71 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. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43930): https://edk2.groups.io/g/devel/message/43930 Mute This Topic: https://groups.io/mt/32513492/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-