Remove superfluous accessor methods for error and warning
counters.

Cc: Ray Ni <ray...@intel.com>
Cc: Zhichao Gao <zhichao....@intel.com>
Signed-off-by: Tomas Pilar <tomas.pi...@arm.com>
---
 .../UefiShellAcpiViewCommandLib/AcpiParser.c  | 54 ++-----------------
 .../UefiShellAcpiViewCommandLib/AcpiParser.h  |  4 ++
 .../UefiShellAcpiViewCommandLib/AcpiView.c    | 12 ++---
 .../UefiShellAcpiViewCommandLib/AcpiView.h    | 36 -------------
 4 files changed, 14 insertions(+), 92 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index 3a029b01cc20..7017fa93efae 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -13,8 +13,10 @@
 #include "AcpiViewConfig.h"
 
 STATIC UINT32   gIndent;
-STATIC UINT32   mTableErrorCount;
-STATIC UINT32   mTableWarningCount;
+
+// Publicly accessible error and warning counters.
+UINT32   mTableErrorCount;
+UINT32   mTableWarningCount;
 
 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
 
@@ -25,54 +27,6 @@ STATIC CONST ACPI_PARSER AcpiHeaderParser[] = {
   PARSE_ACPI_HEADER (&AcpiHdrInfo)
 };
 
-/**
-  This function resets the ACPI table error counter to Zero.
-**/
-VOID
-ResetErrorCount (
-  VOID
-  )
-{
-  mTableErrorCount = 0;
-}
-
-/**
-  This function returns the ACPI table error count.
-
-  @retval Returns the count of errors detected in the ACPI tables.
-**/
-UINT32
-GetErrorCount (
-  VOID
-  )
-{
-  return mTableErrorCount;
-}
-
-/**
-  This function resets the ACPI table warning counter to Zero.
-**/
-VOID
-ResetWarningCount (
-  VOID
-  )
-{
-  mTableWarningCount = 0;
-}
-
-/**
-  This function returns the ACPI table warning count.
-
-  @retval Returns the count of warning detected in the ACPI tables.
-**/
-UINT32
-GetWarningCount (
-  VOID
-  )
-{
-  return mTableWarningCount;
-}
-
 /**
   This function increments the ACPI table error counter.
 **/
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index f81ccac7e118..84eae61c8889 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -16,6 +16,10 @@
 /// that allows us to process the log options.
 #define RSDP_TABLE_INFO  SIGNATURE_32('R', 'S', 'D', 'P')
 
+// Publicly accessible error and warning counters.
+extern UINT32   mTableErrorCount;
+extern UINT32   mTableWarningCount;
+
 /**
   This function increments the ACPI table error counter.
 **/
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
index d0a0edc45f3b..16f498b8c328 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
@@ -197,8 +197,8 @@ AcpiView (
   mBinTableCount = 0;
 
   // Reset The error/warning counters
-  ResetErrorCount ();
-  ResetWarningCount ();
+  mTableErrorCount = 0;
+  mTableWarningCount = 0;
 
   // Search the table for an entry that matches the ACPI Table Guid
   FoundAcpiTable = FALSE;
@@ -276,7 +276,7 @@ AcpiView (
       Print (L"\nTable Statistics:\n");
 
       if (mConfig.ColourHighlighting) {
-        PrintAttribute = (GetErrorCount () > 0) ?
+        PrintAttribute = ((mTableErrorCount) > 0) ?
                             EFI_TEXT_ATTR (
                               EFI_RED,
                               ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)
@@ -284,10 +284,10 @@ AcpiView (
                             OriginalAttribute;
         gST->ConOut->SetAttribute (gST->ConOut, PrintAttribute);
       }
-      Print (L"\t%d Error(s)\n", GetErrorCount ());
+      Print (L"\t%d Error(s)\n", mTableErrorCount);
 
       if (mConfig.ColourHighlighting) {
-        PrintAttribute = (GetWarningCount () > 0) ?
+        PrintAttribute = (mTableWarningCount > 0) ?
                             EFI_TEXT_ATTR (
                               EFI_RED,
                               ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)
@@ -296,7 +296,7 @@ AcpiView (
 
         gST->ConOut->SetAttribute (gST->ConOut, PrintAttribute);
       }
-      Print (L"\t%d Warning(s)\n", GetWarningCount ());
+      Print (L"\t%d Warning(s)\n", mTableWarningCount);
 
       if (mConfig.ColourHighlighting) {
         gST->ConOut->SetAttribute (gST->ConOut, OriginalAttribute);
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
index d5b95f5ee707..6fefe98a4463 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
@@ -23,42 +23,6 @@
 **/
 #define RSDP_LENGTH_OFFSET   20
 
-/**
-  This function resets the ACPI table error counter to Zero.
-**/
-VOID
-ResetErrorCount (
-  VOID
-  );
-
-/**
-  This function returns the ACPI table error count.
-
-  @retval Returns the count of errors detected in the ACPI tables.
-**/
-UINT32
-GetErrorCount (
-  VOID
-  );
-
-/**
-  This function resets the ACPI table warning counter to Zero.
-**/
-VOID
-ResetWarningCount (
-  VOID
-  );
-
-/**
-  This function returns the ACPI table warning count.
-
-  @retval Returns the count of warning detected in the ACPI tables.
-**/
-UINT32
-GetWarningCount (
-  VOID
-  );
-
 /**
   This function processes the table reporting options for the ACPI table.
 
-- 
2.24.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62550): https://edk2.groups.io/g/devel/message/62550
Mute This Topic: https://groups.io/mt/75504251/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to