From: "Krzysztof Koch" <krzysztof.koch@arm.com>
To: <devel@edk2.groups.io>
Cc: <jaben.carsey@intel.com>, <ray.ni@intel.com>,
<zhichao.gao@intel.com>, <Sami.Mujawar@arm.com>,
<Matteo.Carlini@arm.com>, <nd@arm.com>
Subject: [PATCH v1 8/8] ShellPkg: acpiview: DBG2: Remove redundant forward declarations
Date: Thu, 18 Jul 2019 11:05:02 +0100 [thread overview]
Message-ID: <20190718100502.24688-9-krzysztof.koch@arm.com> (raw)
In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com>
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.koch@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)'
next prev parent reply other threads:[~2019-07-18 10:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 10:04 [PATCH v1 0/8] Remove redundant forward declarations in acpiview Krzysztof Koch
2019-07-18 10:04 ` [PATCH v1 1/8] ShellPkg: acpiview: RSDP: Remove redundant forward declarations Krzysztof Koch
2019-07-18 15:34 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:04 ` [PATCH v1 2/8] ShellPkg: acpiview: FADT: " Krzysztof Koch
2019-07-18 15:33 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:04 ` [PATCH v1 3/8] ShellPkg: acpiview: SPCR: Remove redundant forward declaration Krzysztof Koch
2019-07-18 15:33 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:04 ` [PATCH v1 4/8] ShellPkg: acpiview: SRAT: Remove redundant forward declarations Krzysztof Koch
2019-07-18 15:34 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:04 ` [PATCH v1 5/8] ShellPkg: acpiview: MADT: " Krzysztof Koch
2019-07-18 15:34 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:05 ` [PATCH v1 6/8] ShellPkg: acpiview: IORT: " Krzysztof Koch
2019-07-18 15:32 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:05 ` [PATCH v1 7/8] ShellPkg: acpiview: GTDT: " Krzysztof Koch
2019-07-18 15:33 ` [edk2-devel] " Alexei Fedorov
2019-07-18 10:05 ` Krzysztof Koch [this message]
2019-07-18 15:33 ` [edk2-devel] [PATCH v1 8/8] ShellPkg: acpiview: DBG2: " Alexei Fedorov
2019-07-18 11:18 ` [PATCH v1 0/8] Remove redundant forward declarations in acpiview Sami Mujawar
2019-07-18 14:42 ` Carsey, Jaben
2019-07-19 1:08 ` Gao, Zhichao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190718100502.24688-9-krzysztof.koch@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox