public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
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 6/8] ShellPkg: acpiview: IORT: Remove redundant forward declarations
Date: Thu, 18 Jul 2019 11:05:00 +0100	[thread overview]
Message-ID: <20190718100502.24688-7-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/Iort/IortParser.c | 58 +++++---------------
 1 file changed, 14 insertions(+), 44 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
index 93f78e1a9786ed53f6b5529f478b72a220b4f8df..0461205b4f8bc02aa11ab1db1d0deb73bce053b7 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
@@ -45,7 +45,13 @@ EFIAPI
 ValidateItsIdMappingCount (
   IN UINT8* Ptr,
   IN VOID*  Context
-  );
+  )
+{
+  if (*(UINT32*)Ptr != 0) {
+    IncrementErrorCount ();
+    Print (L"\nERROR: IORT ID Mapping count must be zero.");
+  }
+}
 
 /**
   This function validates the ID Mapping array offset for the ITS node.
@@ -60,7 +66,13 @@ EFIAPI
 ValidateItsIdArrayReference (
   IN UINT8* Ptr,
   IN VOID*  Context
-  );
+  )
+{
+  if (*(UINT32*)Ptr != 0) {
+    IncrementErrorCount ();
+    Print (L"\nERROR: IORT ID Mapping offset must be zero.");
+  }
+}
 
 /**
   Helper Macro for populating the IORT Node header in the ACPI_PARSER array.
@@ -210,48 +222,6 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
   {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},
 };
 
-/**
-  This function validates the ID Mapping array count for the ITS node.
-
-  @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
-ValidateItsIdMappingCount (
-  IN UINT8* Ptr,
-  IN VOID*     Context
-  )
-{
-  if (*(UINT32*)Ptr != 0) {
-    IncrementErrorCount ();
-    Print (L"\nERROR: IORT ID Mapping count must be zero.");
-  }
-}
-
-/**
-  This function validates the ID Mapping array offset for the ITS node.
-
-  @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
-ValidateItsIdArrayReference (
-  IN UINT8* Ptr,
-  IN VOID*  Context
-  )
-{
-  if (*(UINT32*)Ptr != 0) {
-    IncrementErrorCount ();
-    Print (L"\nERROR: IORT ID Mapping offset must be zero.");
-  }
-}
-
 /**
   This function parses the IORT Node Id Mapping array.
 
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



  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 ` Krzysztof Koch [this message]
2019-07-18 15:32   ` [edk2-devel] [PATCH v1 6/8] ShellPkg: acpiview: IORT: " 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 ` [PATCH v1 8/8] ShellPkg: acpiview: DBG2: " Krzysztof Koch
2019-07-18 15:33   ` [edk2-devel] " 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-7-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