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: <ray.ni@intel.com>, <zhichao.gao@intel.com>,
	<Matteo.Carlini@arm.com>, <Sami.Mujawar@arm.com>, <nd@arm.com>
Subject: [PATCH v1 1/1] ShellPkg: acpiview: Remove duplicate ACPI structure size definitions
Date: Thu, 30 Jan 2020 11:42:55 +0000	[thread overview]
Message-ID: <20200130114255.57188-1-krzysztof.koch@arm.com> (raw)

Remove duplicate Generic Address Structure (GAS) and ACPI table header
size definitions. Replace any dependencies with the definitions from
Acpi63.h.

AcpiParser.h redefines the size of Generic Address Structure (GAS) and
the ACPI table header. The motivation is to 'minimise any reference to
the EDK2 ACPI headers in an attempt to provide cross checking'. While
the redefined values are unlikely to change, redefinition causes
unnecessary maintenance overhead for acpiview.

In addition to this, EDK2 ACPI headers are referenced throughout the
entire project, so the assumption should be that the definitions in
these header files are correct.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
---

Changes can be seen at: https://github.com/tianocore/edk2/compare/master...KrzysztofKoch1:remove_dup_defs_acpiview_v1?expand=1

Notes:
    v1:
    - Remove duplicate definitions [Krzysztof]

 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c |  8 +++----
 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 22 +-------------------
 2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index 2b2ecb93cef9ee28b752e7bf2d920b059dbf7d6b..ed8767da64280d0b02fe42b7d2120690d5573bba 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -1,7 +1,7 @@
 /** @file
   ACPI parser
 
-  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+  Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -666,7 +666,7 @@ DumpGas (
   IN UINT8*        Ptr
   )
 {
-  DumpGasStruct (Ptr, 2, GAS_LENGTH);
+  DumpGasStruct (Ptr, 2, sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE));
 }
 
 /**
@@ -687,7 +687,7 @@ DumpAcpiHeader (
            0,
            "ACPI Table Header",
            Ptr,
-           ACPI_DESCRIPTION_HEADER_LENGTH,
+           sizeof (EFI_ACPI_DESCRIPTION_HEADER),
            PARSER_PARAMS (AcpiHeaderParser)
            );
 }
@@ -721,7 +721,7 @@ ParseAcpiHeader (
                   0,
                   NULL,
                   Ptr,
-                  ACPI_DESCRIPTION_HEADER_LENGTH,
+                  sizeof (EFI_ACPI_DESCRIPTION_HEADER),
                   PARSER_PARAMS (AcpiHeaderParser)
                   );
 
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 6deee3542e09bc18b03fdd18dece5b6f9725839c..f81ccac7e118378aa185db4b625e5bcd75f78347 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -1,7 +1,7 @@
 /** @file
   Header file for ACPI parser
 
-  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+  Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -396,26 +396,6 @@ ParseAcpi (
   { L"Creator Revision", 4, 32, L"0x%X", NULL,    \
     (VOID**)&(Info)->CreatorRevision, NULL, NULL }
 
-/**
-  Length of the ACPI GAS structure.
-
-  NOTE: This might normally be defined as
-        sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE).
-        However, we deliberately minimise any reference to the EDK2 ACPI
-        headers in an attempt to provide cross checking.
-**/
-#define GAS_LENGTH                     12
-
-/**
-  Length of the ACPI Header structure.
-
-  NOTE: This might normally be defined as
-        sizeof (EFI_ACPI_DESCRIPTION_HEADER).
-        However, we deliberately minimise any reference to the EDK2 ACPI
-        headers in an attempt to provide cross checking.
-**/
-#define ACPI_DESCRIPTION_HEADER_LENGTH  36
-
 /**
   This function indents and traces the GAS structure as described by the GasParser.
 
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



             reply	other threads:[~2020-01-30 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 11:42 Krzysztof Koch [this message]
2020-01-30 11:58 ` [PATCH v1 1/1] ShellPkg: acpiview: Remove duplicate ACPI structure size definitions Sami Mujawar
2020-02-11  3:27 ` 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=20200130114255.57188-1-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