]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: acpiview: FADT: Remove redundant forward declarations
authorKrzysztof Koch <krzysztof.koch@arm.com>
Fri, 19 Jul 2019 01:04:56 +0000 (18:04 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Fri, 19 Jul 2019 15:32:43 +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/Fadt/FadtParser.c

index cee7ee0770433da96d6042d2f5d687903f4b5495..e40c9ef8ee4b3285faf8c6edf3cb6236ee367397 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FADT 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
@@ -46,7 +46,17 @@ EFIAPI
 ValidateFirmwareCtrl (\r
   IN UINT8* Ptr,\r
   IN VOID*  Context\r
-  );\r
+)\r
+{\r
+#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
+  if (*(UINT32*)Ptr != 0) {\r
+    IncrementErrorCount ();\r
+    Print (\r
+      L"\nERROR: Firmware Control must be zero for ARM platforms."\r
+    );\r
+  }\r
+#endif\r
+}\r
 \r
 /**\r
   This function validates the X_Firmware Control Field.\r
@@ -61,7 +71,17 @@ EFIAPI
 ValidateXFirmwareCtrl (\r
   IN UINT8* Ptr,\r
   IN VOID*  Context\r
-  );\r
+)\r
+{\r
+#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
+  if (*(UINT64*)Ptr != 0) {\r
+    IncrementErrorCount ();\r
+    Print (\r
+      L"\nERROR: X Firmware Control must be zero for ARM platforms."\r
+    );\r
+  }\r
+#endif\r
+}\r
 \r
 /**\r
   This function validates the flags.\r
@@ -76,7 +96,17 @@ EFIAPI
 ValidateFlags (\r
   IN UINT8* Ptr,\r
   IN VOID*  Context\r
-  );\r
+)\r
+{\r
+#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
+  if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) == 0) {\r
+    IncrementErrorCount ();\r
+    Print (\r
+      L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms."\r
+    );\r
+  }\r
+#endif\r
+}\r
 \r
 /**\r
   An ACPI_PARSER array describing the ACPI FADT Table.\r
@@ -142,81 +172,6 @@ STATIC CONST ACPI_PARSER FadtParser[] = {
   {L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/**\r
-  This function validates the Firmware Control Field.\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
-ValidateFirmwareCtrl (\r
-  IN UINT8* Ptr,\r
-  IN VOID*  Context\r
-)\r
-{\r
-#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
-  if (*(UINT32*)Ptr != 0) {\r
-    IncrementErrorCount ();\r
-    Print (\r
-      L"\nERROR: Firmware Control must be zero for ARM platforms."\r
-    );\r
-  }\r
-#endif\r
-}\r
-\r
-/**\r
-  This function validates the X_Firmware Control Field.\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
-ValidateXFirmwareCtrl (\r
-  IN UINT8* Ptr,\r
-  IN VOID*  Context\r
-)\r
-{\r
-#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
-  if (*(UINT64*)Ptr != 0) {\r
-    IncrementErrorCount ();\r
-    Print (\r
-      L"\nERROR: X Firmware Control must be zero for ARM platforms."\r
-    );\r
-  }\r
-#endif\r
-}\r
-\r
-/**\r
-  This function validates the flags.\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
-ValidateFlags (\r
-  IN UINT8* Ptr,\r
-  IN VOID*  Context\r
-)\r
-{\r
-#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
-  if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) == 0) {\r
-    IncrementErrorCount ();\r
-    Print (\r
-      L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms."\r
-    );\r
-  }\r
-#endif\r
-}\r
-\r
 /**\r
   This function parses the ACPI FADT table.\r
   This function parses the FADT table and optionally traces the ACPI table fields.\r