]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / AcpiTableDxe / AmlChild.c
index d663feaecba79d59d1a62f3872031c2c8e542553..0c154576c103888f648743d9d6ef63b75baaa180 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   ACPI Sdt Protocol Driver\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 \r
 /**\r
   Return the child objects buffer from AML Handle's buffer.\r
-  \r
+\r
   @param[in]        AmlParentHandle Parent handle.\r
   @param[in]        CurrentBuffer   The current child buffer.\r
   @param[out]       Buffer          On return, points to the next returned child buffer or NULL if there are no\r
                                     child buffer.\r
 \r
   @retval EFI_SUCCESS               Success\r
-  @retval EFI_INVALID_PARAMETER     AmlParentHandle does not refer to a valid ACPI object.                                \r
+  @retval EFI_INVALID_PARAMETER     AmlParentHandle does not refer to a valid ACPI object.\r
 **/\r
 EFI_STATUS\r
 AmlGetChildFromObjectBuffer (\r
-  IN EFI_AML_HANDLE         *AmlParentHandle,\r
-  IN UINT8                  *CurrentBuffer,\r
-  OUT VOID                  **Buffer\r
+  IN EFI_AML_HANDLE  *AmlParentHandle,\r
+  IN UINT8           *CurrentBuffer,\r
+  OUT VOID           **Buffer\r
   )\r
 {\r
-  AML_BYTE_ENCODING   *AmlByteEncoding;\r
-  UINTN               DataSize;\r
+  AML_BYTE_ENCODING  *AmlByteEncoding;\r
+  UINTN              DataSize;\r
 \r
   //\r
   // Root is considered as SCOPE, which has TermList.\r
@@ -44,6 +38,7 @@ AmlGetChildFromObjectBuffer (
     if (AmlByteEncoding == NULL) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
+\r
     //\r
     // NOTE: We need return everything, because user might need parse the returned object.\r
     //\r
@@ -60,6 +55,7 @@ AmlGetChildFromObjectBuffer (
     if (DataSize == 0) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
+\r
     CurrentBuffer += DataSize;\r
   }\r
 \r
@@ -72,23 +68,23 @@ AmlGetChildFromObjectBuffer (
 \r
 /**\r
   Return the child ACPI objects from Root Handle.\r
-  \r
+\r
   @param[in]        AmlParentHandle Parent handle. It is Root Handle.\r
   @param[in]        AmlHandle       The previously returned handle or NULL to start with the first handle.\r
   @param[out]       Buffer          On return, points to the next returned ACPI handle or NULL if there are no\r
                                     child objects.\r
 \r
   @retval EFI_SUCCESS               Success\r
-  @retval EFI_INVALID_PARAMETER     ParentHandle is NULL or does not refer to a valid ACPI object.                                \r
+  @retval EFI_INVALID_PARAMETER     ParentHandle is NULL or does not refer to a valid ACPI object.\r
 **/\r
 EFI_STATUS\r
 AmlGetChildFromRoot (\r
-  IN EFI_AML_HANDLE         *AmlParentHandle,\r
-  IN EFI_AML_HANDLE         *AmlHandle,\r
-  OUT VOID                  **Buffer\r
+  IN EFI_AML_HANDLE  *AmlParentHandle,\r
+  IN EFI_AML_HANDLE  *AmlHandle,\r
+  OUT VOID           **Buffer\r
   )\r
 {\r
-  UINT8               *CurrentBuffer;\r
+  UINT8  *CurrentBuffer;\r
 \r
   if (AmlHandle == NULL) {\r
     //\r
@@ -104,20 +100,20 @@ AmlGetChildFromRoot (
 \r
 /**\r
   Return the child objects buffer from AML Handle's option list.\r
-  \r
+\r
   @param[in]        AmlParentHandle Parent handle.\r
   @param[in]        AmlHandle       The current child handle.\r
   @param[out]       Buffer          On return, points to the next returned child buffer or NULL if there are no\r
                                     child buffer.\r
 \r
   @retval EFI_SUCCESS               Success\r
-  @retval EFI_INVALID_PARAMETER     AmlParentHandle does not refer to a valid ACPI object.                                \r
+  @retval EFI_INVALID_PARAMETER     AmlParentHandle does not refer to a valid ACPI object.\r
 **/\r
 EFI_STATUS\r
 AmlGetChildFromOptionList (\r
-  IN EFI_AML_HANDLE         *AmlParentHandle,\r
-  IN EFI_AML_HANDLE         *AmlHandle,\r
-  OUT VOID                  **Buffer\r
+  IN EFI_AML_HANDLE  *AmlParentHandle,\r
+  IN EFI_AML_HANDLE  *AmlHandle,\r
+  OUT VOID           **Buffer\r
   )\r
 {\r
   EFI_ACPI_DATA_TYPE  DataType;\r
@@ -127,7 +123,7 @@ AmlGetChildFromOptionList (
   EFI_STATUS          Status;\r
   AML_OP_PARSE_INDEX  MaxTerm;\r
 \r
-  Index = AML_OP_PARSE_INDEX_GET_TERM1;\r
+  Index   = AML_OP_PARSE_INDEX_GET_TERM1;\r
   MaxTerm = AmlParentHandle->AmlByteEncoding->MaxIndex;\r
   while (Index <= MaxTerm) {\r
     Status = AmlParseOptionHandleCommon (\r
@@ -140,6 +136,7 @@ AmlGetChildFromOptionList (
     if (EFI_ERROR (Status)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
+\r
     if (DataType == EFI_ACPI_DATA_TYPE_NONE) {\r
       //\r
       // Not found\r
@@ -151,17 +148,19 @@ AmlGetChildFromOptionList (
     // Find it, and Check Data\r
     //\r
     if ((DataType == EFI_ACPI_DATA_TYPE_CHILD) &&\r
-        ((UINTN)AmlHandle->Buffer < (UINTN)Data)) {\r
+        ((UINTN)AmlHandle->Buffer < (UINTN)Data))\r
+    {\r
       //\r
       // Buffer < Data means current node is next one\r
       //\r
       *Buffer = Data;\r
       return EFI_SUCCESS;\r
     }\r
+\r
     //\r
     // Not Child\r
     //\r
-    Index ++;\r
+    Index++;\r
   }\r
 \r
   *Buffer = NULL;\r
@@ -170,24 +169,26 @@ AmlGetChildFromOptionList (
 \r
 /**\r
   Return the child objects buffer from AML Handle's object child list.\r
-  \r
+\r
   @param[in]        AmlParentHandle Parent handle.\r
   @param[in]        AmlHandle       The current child handle.\r
   @param[out]       Buffer          On return, points to the next returned child buffer or NULL if there are no\r
                                     child buffer.\r
 \r
   @retval EFI_SUCCESS               Success\r
-  @retval EFI_INVALID_PARAMETER     AmlParentHandle does not refer to a valid ACPI object.                                \r
+  @retval EFI_INVALID_PARAMETER     AmlParentHandle does not refer to a valid ACPI object.\r
 **/\r
 EFI_STATUS\r
 AmlGetChildFromObjectChildList (\r
-  IN EFI_AML_HANDLE         *AmlParentHandle,\r
-  IN EFI_AML_HANDLE         *AmlHandle,\r
-  OUT VOID                  **Buffer\r
+  IN EFI_AML_HANDLE  *AmlParentHandle,\r
+  IN EFI_AML_HANDLE  *AmlHandle,\r
+  OUT VOID           **Buffer\r
   )\r
 {\r
-  EFI_STATUS          Status;\r
-  UINT8               *CurrentBuffer;\r
+  EFI_STATUS  Status;\r
+  UINT8       *CurrentBuffer;\r
+\r
+  CurrentBuffer = NULL;\r
 \r
   if ((AmlParentHandle->AmlByteEncoding->Attribute & AML_HAS_CHILD_OBJ) == 0) {\r
     //\r
@@ -235,23 +236,23 @@ AmlGetChildFromObjectChildList (
 \r
 /**\r
   Return the child ACPI objects from Non-Root Handle.\r
-  \r
+\r
   @param[in]        AmlParentHandle Parent handle. It is Non-Root Handle.\r
   @param[in]        AmlHandle       The previously returned handle or NULL to start with the first handle.\r
   @param[out]       Buffer          On return, points to the next returned ACPI handle or NULL if there are no\r
                                     child objects.\r
 \r
   @retval EFI_SUCCESS               Success\r
-  @retval EFI_INVALID_PARAMETER     ParentHandle is NULL or does not refer to a valid ACPI object.                                \r
+  @retval EFI_INVALID_PARAMETER     ParentHandle is NULL or does not refer to a valid ACPI object.\r
 **/\r
 EFI_STATUS\r
 AmlGetChildFromNonRoot (\r
-  IN EFI_AML_HANDLE         *AmlParentHandle,\r
-  IN EFI_AML_HANDLE         *AmlHandle,\r
-  OUT VOID                  **Buffer\r
+  IN EFI_AML_HANDLE  *AmlParentHandle,\r
+  IN EFI_AML_HANDLE  *AmlHandle,\r
+  OUT VOID           **Buffer\r
   )\r
 {\r
-  EFI_STATUS          Status;\r
+  EFI_STATUS  Status;\r
 \r
   if (AmlHandle == NULL) {\r
     //\r
@@ -267,6 +268,7 @@ AmlGetChildFromNonRoot (
   if (EFI_ERROR (Status)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+\r
   if (*Buffer != NULL) {\r
     return EFI_SUCCESS;\r
   }\r