]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: acpiview: SRAT: Remove redundant forward declarations
authorKrzysztof Koch <krzysztof.koch@arm.com>
Fri, 19 Jul 2019 01:04:58 +0000 (18:04 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Fri, 19 Jul 2019 15:32:53 +0000 (08:32 -0700)
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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c

index 075ff2a141a82b522e8aaedb7ad79249aaf5eaac..03d28d52842040e4872e204fc10ae3dba7861936 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SRAT table parser\r
 \r
-  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.\r
+  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   @par Reference(s):\r
@@ -32,7 +32,13 @@ EFIAPI
 ValidateSratReserved (\r
   IN UINT8* Ptr,\r
   IN VOID*  Context\r
-  );\r
+  )\r
+{\r
+  if (*(UINT32*)Ptr != 1) {\r
+    IncrementErrorCount ();\r
+    Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n");\r
+  }\r
+}\r
 \r
 /**\r
   This function traces the APIC Proximity Domain field.\r
@@ -44,9 +50,16 @@ STATIC
 VOID\r
 EFIAPI\r
 DumpSratApicProximity (\r
-  IN  CONST CHAR16*  Format,\r
-  IN  UINT8*         Ptr\r
-  );\r
+ IN CONST CHAR16* Format,\r
+ IN UINT8*        Ptr\r
+ )\r
+{\r
+  UINT32 ProximityDomain;\r
+\r
+  ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);\r
+\r
+  Print (Format, ProximityDomain);\r
+}\r
 \r
 /**\r
   An ACPI_PARSER array describing the SRAT Table.\r
@@ -139,47 +152,6 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = {
   {L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** This function validates the Reserved field in the SRAT table header.\r
-\r
-  @param [in] Ptr     Pointer to the start of the field data.\r
-  @param [in] Context Pointer to context specific information e.g. this\r
-                      could be a pointer to the ACPI table header.\r
-**/\r
-STATIC\r
-VOID\r
-EFIAPI\r
-ValidateSratReserved (\r
-  IN UINT8* Ptr,\r
-  IN VOID*  Context\r
-  )\r
-{\r
-  if (*(UINT32*)Ptr != 1) {\r
-    IncrementErrorCount ();\r
-    Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n");\r
-  }\r
-}\r
-\r
-/**\r
-  This function traces the APIC Proximity Domain field.\r
-\r
-  @param [in] Format  Format string for tracing the data.\r
-  @param [in] Ptr     Pointer to the start of the buffer.\r
-**/\r
-STATIC\r
-VOID\r
-EFIAPI\r
-DumpSratApicProximity (\r
- IN CONST CHAR16* Format,\r
- IN UINT8*        Ptr\r
- )\r
-{\r
-  UINT32 ProximityDomain;\r
-\r
-  ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);\r
-\r
-  Print (Format, ProximityDomain);\r
-}\r
-\r
 /**\r
   This function parses the ACPI SRAT table.\r
   When trace is enabled this function parses the SRAT table and\r