From 386fbe1a6bff65f6fd83a64eb72ac663a511655b Mon Sep 17 00:00:00 2001 From: Krzysztof Koch Date: Thu, 18 Jul 2019 18:04:55 -0700 Subject: [PATCH] ShellPkg: acpiview: RSDP: 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/Rsdp/RsdpParser.c | 64 +++++-------------- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c index 586de7cbfb..4bf928139a 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c @@ -1,7 +1,7 @@ /** @file RSDP table parser - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): @@ -15,52 +15,6 @@ // Local Variables STATIC CONST UINT64* XsdtAddress; -/** - This function validates the RSDT Address. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateRsdtAddress ( - IN UINT8* Ptr, - IN VOID* Context - ); - -/** - This function validates the XSDT Address. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateXsdtAddress ( - IN UINT8* Ptr, - IN VOID* Context - ); - -/** - An array describing the ACPI RSDP Table. -**/ -STATIC CONST ACPI_PARSER RsdpParser[] = { - {L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL}, - {L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL}, - {L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL}, - {L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL}, - {L"RSDT Address", 4, 16, L"0x%x", NULL, NULL, ValidateRsdtAddress, NULL}, - {L"Length", 4, 20, L"%d", NULL, NULL, NULL, NULL}, - {L"XSDT Address", 8, 24, L"0x%lx", NULL, (VOID**)&XsdtAddress, - ValidateXsdtAddress, NULL}, - {L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL}, - {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} -}; - /** This function validates the RSDT Address. @@ -131,6 +85,22 @@ ValidateXsdtAddress ( #endif } +/** + An array describing the ACPI RSDP Table. +**/ +STATIC CONST ACPI_PARSER RsdpParser[] = { + {L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL}, + {L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL}, + {L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL}, + {L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL}, + {L"RSDT Address", 4, 16, L"0x%x", NULL, NULL, ValidateRsdtAddress, NULL}, + {L"Length", 4, 20, L"%d", NULL, NULL, NULL, NULL}, + {L"XSDT Address", 8, 24, L"0x%lx", NULL, (VOID**)&XsdtAddress, + ValidateXsdtAddress, NULL}, + {L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL}, + {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} +}; + /** This function parses the ACPI RSDP table.