From: "Sami Mujawar" <sami.mujawar@arm.com>
To: <devel@edk2.groups.io>
Cc: Sami Mujawar <sami.mujawar@arm.com>, <ray.ni@intel.com>,
<zhichao.gao@intel.com>, <Matteo.Carlini@arm.com>,
<Ben.Adderson@arm.com>, <nd@arm.com>
Subject: [PATCH v2-resend 2/2] ShellPkg/AcpiView: Fix field validator invocation
Date: Wed, 4 Nov 2020 12:18:20 +0000 [thread overview]
Message-ID: <20201104121821.18728-2-sami.mujawar@arm.com> (raw)
In-Reply-To: <20201104121821.18728-1-sami.mujawar@arm.com>
Bugzilla: 3046 (https://bugzilla.tianocore.org/show_bug.cgi?id=3046)
The field validator function provides means to validate fields
in the ACPI table structures. To print complex field types a
print formatter function is provided.
The field validator was being invoked for simple data fields
for which the default print format is used. However, the field
validator function was not invoked if a print formatter function
was provided.
This problem is noticed when a Generic Address Structure (GAS)
is printed using DumpGas() and a field validator is present
to validate the GAS structure.
To fix this move the invocation of the field validator after
the field is printed such that the validation function is
called even when a print formatter function is present.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
Notes:
v2:
- This is a new patch introduced in v2 series. [SAMI]
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index 02f6d771c7e1a9b8faa577b38e51c9de350d24fd..01ac9a9bafeb2ca12c1ba19f406d626b108f5fe2 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -1,7 +1,7 @@
/** @file
ACPI parser
- Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -596,13 +596,12 @@ ParseAcpi (
Parser[Index].Length
);
} // switch
-
- // Validating only makes sense if we are tracing
- // the parsed table entries, to report by table name.
- if (GetConsistencyChecking () &&
- (Parser[Index].FieldValidator != NULL)) {
- Parser[Index].FieldValidator (Ptr, Parser[Index].Context);
- }
+ }
+ // Validating only makes sense if we are tracing
+ // the parsed table entries, to report by table name.
+ if (GetConsistencyChecking () &&
+ (Parser[Index].FieldValidator != NULL)) {
+ Parser[Index].FieldValidator (Ptr, Parser[Index].Context);
}
Print (L"\n");
} // if (Trace)
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
next prev parent reply other threads:[~2020-11-04 12:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 12:18 [PATCH v2-resend 0/2] ShellPkg/Acpiview: Add support for PCCT parser Sami Mujawar
2020-11-04 12:18 ` Sami Mujawar [this message]
2020-11-04 12:26 ` [edk2-devel] [PATCH v2-resend 2/2] ShellPkg/AcpiView: Fix field validator invocation Sami Mujawar
2020-11-04 12:18 ` [PATCH v2-resend 1/2] ShellPkg/AcpiView: PCCT Parser Sami Mujawar
2020-11-04 12:26 ` [edk2-devel] " Sami Mujawar
2020-12-10 8:49 ` Gao, Zhichao
2020-12-10 9:05 ` Sami Mujawar
2020-12-10 9:37 ` [edk2-devel] " Gao, Zhichao
2020-11-04 12:23 ` [edk2-devel] [PATCH v2-resend 0/2] ShellPkg/Acpiview: Add support for PCCT parser Sami Mujawar
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=20201104121821.18728-2-sami.mujawar@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