]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/LinkedList.c
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseLib / LinkedList.c
index 30fd7009e0078b98506f54431ebd116f62d01c7f..799bda39068911540a5fd62a245ccbae04eb86b4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Linked List Library Functions.\r
 \r
-  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2018, 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
@@ -59,9 +59,9 @@
 \r
   @retval   TRUE if PcdVerifyNodeInList is FALSE\r
   @retval   TRUE if DoMembershipCheck is FALSE\r
-  @retval   TRUE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE \r
+  @retval   TRUE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE\r
             and Node is a member of List.\r
-  @retval   FALSE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE \r
+  @retval   FALSE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE\r
             and Node is in not a member of List.\r
 \r
 **/\r
@@ -143,7 +143,7 @@ IsNodeInList (
   Ptr   = FirstEntry;\r
 \r
   //\r
-  // Check to see if SecondEntry is a member of FirstEntry.  \r
+  // Check to see if SecondEntry is a member of FirstEntry.\r
   // Exit early if the number of nodes in List >= PcdMaximumLinkedListLength\r
   //\r
   do {\r
@@ -230,7 +230,7 @@ InsertHeadList (
   // ASSERT List not too long and Entry is not one of the nodes of List\r
   //\r
   ASSERT_VERIFY_NODE_IN_VALID_LIST (ListHead, Entry, FALSE);\r
-  \r
+\r
   Entry->ForwardLink = ListHead->ForwardLink;\r
   Entry->BackLink = ListHead;\r
   Entry->ForwardLink->BackLink = Entry;\r
@@ -247,7 +247,7 @@ InsertHeadList (
 \r
   If ListHead is NULL, then ASSERT().\r
   If Entry is NULL, then ASSERT().\r
-  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
   InitializeListHead(), then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and prior to insertion the number\r
   of nodes in ListHead, including the ListHead node, is greater than or\r
@@ -271,7 +271,7 @@ InsertTailList (
   // ASSERT List not too long and Entry is not one of the nodes of List\r
   //\r
   ASSERT_VERIFY_NODE_IN_VALID_LIST (ListHead, Entry, FALSE);\r
-  \r
+\r
   Entry->ForwardLink = ListHead;\r
   Entry->BackLink = ListHead->BackLink;\r
   Entry->BackLink->ForwardLink = Entry;\r
@@ -282,12 +282,12 @@ InsertTailList (
 /**\r
   Retrieves the first node of a doubly-linked list.\r
 \r
-  Returns the first node of a doubly-linked list.  List must have been \r
+  Returns the first node of a doubly-linked list.  List must have been\r
   initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().\r
   If List is empty, then List is returned.\r
 \r
   If List is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
   InitializeListHead(), then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and the number of nodes\r
   in List, including the List node, is greater than or equal to\r
@@ -316,13 +316,13 @@ GetFirstNode (
 /**\r
   Retrieves the next node of a doubly-linked list.\r
 \r
-  Returns the node of a doubly-linked list that follows Node.  \r
+  Returns the node of a doubly-linked list that follows Node.\r
   List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()\r
   or InitializeListHead().  If List is empty, then List is returned.\r
 \r
   If List is NULL, then ASSERT().\r
   If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
   InitializeListHead(), then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and List contains more than\r
   PcdMaximumLinkedListLength nodes, then ASSERT().\r
@@ -351,24 +351,24 @@ GetNextNode (
 \r
 /**\r
   Retrieves the previous node of a doubly-linked list.\r
\r
-  Returns the node of a doubly-linked list that precedes Node.  \r
+\r
+  Returns the node of a doubly-linked list that precedes Node.\r
   List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()\r
   or InitializeListHead().  If List is empty, then List is returned.\r
\r
+\r
   If List is NULL, then ASSERT().\r
   If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
   InitializeListHead(), then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and List contains more than\r
   PcdMaximumLinkedListLength nodes, then ASSERT().\r
   If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().\r
\r
+\r
   @param  List  A pointer to the head node of a doubly-linked list.\r
   @param  Node  A pointer to a node in the doubly-linked list.\r
\r
+\r
   @return A pointer to the previous node if one exists. Otherwise List is returned.\r
\r
+\r
 **/\r
 LIST_ENTRY *\r
 EFIAPI\r
@@ -381,7 +381,7 @@ GetPreviousNode (
   // ASSERT List not too long and Node is one of the nodes of List\r
   //\r
   ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);\r
\r
+\r
   return Node->BackLink;\r
 }\r
 \r
@@ -392,7 +392,7 @@ GetPreviousNode (
   zero nodes, this function returns TRUE. Otherwise, it returns FALSE.\r
 \r
   If ListHead is NULL, then ASSERT().\r
-  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
   InitializeListHead(), then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and the number of nodes\r
   in List, including the List node, is greater than or equal to\r
@@ -414,7 +414,7 @@ IsListEmpty (
   // ASSERT List not too long\r
   //\r
   ASSERT (InternalBaseLibIsListValid (ListHead));\r
-  \r
+\r
   return (BOOLEAN)(ListHead->ForwardLink == ListHead);\r
 }\r
 \r
@@ -429,12 +429,12 @@ IsListEmpty (
 \r
   If List is NULL, then ASSERT().\r
   If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(), \r
+  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(),\r
   then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and the number of nodes\r
   in List, including the List node, is greater than or equal to\r
   PcdMaximumLinkedListLength, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and Node is not a node in List and Node is not \r
+  If PcdVerifyNodeInList is TRUE and Node is not a node in List and Node is not\r
   equal to List, then ASSERT().\r
 \r
   @param  List  A pointer to the head node of a doubly-linked list.\r
@@ -455,7 +455,7 @@ IsNull (
   // ASSERT List not too long and Node is one of the nodes of List\r
   //\r
   ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);\r
-  \r
+\r
   return (BOOLEAN)(Node == List);\r
 }\r
 \r
@@ -493,7 +493,7 @@ IsNodeAtEnd (
   // ASSERT List not too long and Node is one of the nodes of List\r
   //\r
   ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);\r
-  \r
+\r
   return (BOOLEAN)(!IsNull (List, Node) && List->BackLink == Node);\r
 }\r
 \r
@@ -505,12 +505,12 @@ IsNodeAtEnd (
   Otherwise, the location of the FirstEntry node is swapped with the location\r
   of the SecondEntry node in a doubly-linked list. SecondEntry must be in the\r
   same double linked list as FirstEntry and that double linked list must have\r
-  been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). \r
+  been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().\r
   SecondEntry is returned after the nodes are swapped.\r
 \r
   If FirstEntry is NULL, then ASSERT().\r
   If SecondEntry is NULL, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the \r
+  If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the\r
   same linked list, then ASSERT().\r
   If PcdMaximumLinkedListLength is not zero, and the number of nodes in the\r
   linked list containing the FirstEntry and SecondEntry nodes, including\r
@@ -519,7 +519,7 @@ IsNodeAtEnd (
 \r
   @param  FirstEntry  A pointer to a node in a linked list.\r
   @param  SecondEntry A pointer to another node in the same linked list.\r
-  \r
+\r
   @return SecondEntry.\r
 \r
 **/\r
@@ -540,7 +540,7 @@ SwapListEntries (
   // ASSERT Entry1 and Entry2 are in the same linked list\r
   //\r
   ASSERT_VERIFY_NODE_IN_VALID_LIST (FirstEntry, SecondEntry, TRUE);\r
-  \r
+\r
   //\r
   // Ptr is the node pointed to by FirstEntry->ForwardLink\r
   //\r
@@ -598,7 +598,7 @@ RemoveEntryList (
   )\r
 {\r
   ASSERT (!IsListEmpty (Entry));\r
-  \r
+\r
   Entry->ForwardLink->BackLink = Entry->BackLink;\r
   Entry->BackLink->ForwardLink = Entry->ForwardLink;\r
   return Entry->ForwardLink;\r