]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / SectionExtractionDxe / SectionExtraction.c
index cacac486bbfece03bbeb098566e4930f68da0cd3..fd4db26e0ddf1786776d5c1b395db33aa97dd93f 100644 (file)
@@ -1,33 +1,33 @@
 /** @file\r
   Section Extraction Protocol implementation.\r
-  \r
+\r
   Stream database is implemented as a linked list of section streams,\r
   where each stream contains a linked list of children, which may be leaves or\r
-  encapsulations.  \r
-  \r
+  encapsulations.\r
+\r
   Children that are encapsulations generate new stream entries\r
-  when they are created.  Streams can also be created by calls to \r
+  when they are created.  Streams can also be created by calls to\r
   SEP->OpenSectionStream().\r
-  \r
+\r
   The database is only created far enough to return the requested data from\r
   any given stream, or to determine that the requested data is not found.\r
-  \r
+\r
   If a GUIDed encapsulation is encountered, there are three possiblilites.\r
-  \r
+\r
   1) A support protocol is found, in which the stream is simply processed with\r
      the support protocol.\r
-     \r
+\r
   2) A support protocol is not found, but the data is available to be read\r
      without processing.  In this case, the database is built up through the\r
      recursions to return the data, and a RPN event is set that will enable\r
      the stream in question to be refreshed if and when the required section\r
-     extraction protocol is published.This insures the AuthenticationStatus \r
+     extraction protocol is published.This insures the AuthenticationStatus\r
      does not become stale in the cache.\r
-     \r
+\r
   3) A support protocol is not found, and the data is not available to be read\r
      without it.  This results in EFI_PROTOCOL_ERROR.\r
 \r
-Copyright (c) 2006 - 2016, 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
@@ -77,7 +77,7 @@ typedef struct {
   UINTN                       EncapsulatedStreamHandle;\r
   EFI_GUID                    *EncapsulationGuid;\r
   //\r
-  // If the section REQUIRES an extraction protocol, register for RPN \r
+  // If the section REQUIRES an extraction protocol, register for RPN\r
   // when the required GUIDed extraction protocol becomes available.\r
   //\r
   EFI_EVENT                   Event;\r
@@ -157,22 +157,22 @@ OpenSectionStream (
   @param AuthenticationStatus  Indicates the authentication status of the retrieved\r
                                section.\r
 \r
\r
+\r
   @retval EFI_SUCCESS           Section was retrieved successfully\r
-  @retval EFI_PROTOCOL_ERROR    A GUID defined section was encountered in the section \r
+  @retval EFI_PROTOCOL_ERROR    A GUID defined section was encountered in the section\r
                                 stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED\r
-                                bit set, but there was no corresponding GUIDed Section \r
-                                Extraction Protocol in the handle database.  *Buffer is \r
+                                bit set, but there was no corresponding GUIDed Section\r
+                                Extraction Protocol in the handle database.  *Buffer is\r
                                 unmodified.\r
   @retval EFI_NOT_FOUND         An error was encountered when parsing the SectionStream.\r
-                                This indicates the SectionStream  is not correctly \r
+                                This indicates the SectionStream  is not correctly\r
                                 formatted.\r
   @retval EFI_NOT_FOUND         The requested section does not exist.\r
-  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process the \r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process the\r
                                 request.\r
   @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
-  @retval EFI_WARN_TOO_SMALL    The size of the caller allocated input buffer is \r
-                                insufficient to contain the requested section.  The \r
+  @retval EFI_WARN_TOO_SMALL    The size of the caller allocated input buffer is\r
+                                insufficient to contain the requested section.  The\r
                                 input buffer is filled and contents are section contents\r
                                 are truncated.\r
 \r
@@ -218,18 +218,18 @@ LIST_ENTRY mStreamRoot = INITIALIZE_LIST_HEAD_VARIABLE (mStreamRoot);
 \r
 EFI_HANDLE mSectionExtractionHandle = NULL;\r
 \r
-EFI_SECTION_EXTRACTION_PROTOCOL mSectionExtraction = { \r
-  OpenSectionStream, \r
-  GetSection, \r
+EFI_SECTION_EXTRACTION_PROTOCOL mSectionExtraction = {\r
+  OpenSectionStream,\r
+  GetSection,\r
   CloseSectionStream\r
 };\r
 \r
 /**\r
-  Entry point of the section extraction code. Initializes an instance of the \r
+  Entry point of the section extraction code. Initializes an instance of the\r
   section extraction interface and installs it on a new handle.\r
 \r
   @param ImageHandle             A handle for the image that is initializing this driver\r
-  @param SystemTable             A pointer to the EFI system table        \r
+  @param SystemTable             A pointer to the EFI system table\r
 \r
   @retval EFI_SUCCESS            Driver initialized successfully\r
   @retval EFI_OUT_OF_RESOURCES   Could not allocate needed resources\r
@@ -281,7 +281,7 @@ IsValidSectionStream (
 \r
   TotalLength = 0;\r
   SectionHeader = (EFI_COMMON_SECTION_HEADER *)SectionStream;\r
-  \r
+\r
   while (TotalLength < SectionStreamLength) {\r
     if (IS_SECTION2 (SectionHeader)) {\r
       SectionLength = SECTION2_SIZE (SectionHeader);\r
@@ -291,14 +291,14 @@ IsValidSectionStream (
     TotalLength += SectionLength;\r
 \r
     if (TotalLength == SectionStreamLength) {\r
-      return TRUE;    \r
+      return TRUE;\r
     }\r
 \r
     //\r
     // Move to the next byte following the section...\r
     //\r
     SectionHeader = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) SectionHeader + SectionLength);\r
-    \r
+\r
     //\r
     // Figure out where the next section begins\r
     //\r
@@ -331,13 +331,13 @@ OpenSectionStreamEx (
   IN     UINTN                                     SectionStreamLength,\r
   IN     VOID                                      *SectionStream,\r
   IN     BOOLEAN                                   AllocateBuffer,\r
-  IN     UINT32                                    AuthenticationStatus,   \r
+  IN     UINT32                                    AuthenticationStatus,\r
      OUT UINTN                                     *SectionStreamHandle\r
   )\r
 {\r
   FRAMEWORK_SECTION_STREAM_NODE    *NewStream;\r
   EFI_TPL                          OldTpl;\r
-  \r
+\r
   //\r
   // Allocate a new stream\r
   //\r
@@ -345,14 +345,14 @@ OpenSectionStreamEx (
   if (NewStream == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
-  if (AllocateBuffer) { \r
+\r
+  if (AllocateBuffer) {\r
     //\r
     // if we're here, we're double buffering, allocate the buffer and copy the\r
     // data in\r
     //\r
     if (SectionStreamLength > 0) {\r
-      NewStream->StreamBuffer = AllocatePool (SectionStreamLength); \r
+      NewStream->StreamBuffer = AllocatePool (SectionStreamLength);\r
       if (NewStream->StreamBuffer == NULL) {\r
         FreePool (NewStream);\r
         return EFI_OUT_OF_RESOURCES;\r
@@ -375,7 +375,7 @@ OpenSectionStreamEx (
     //\r
     NewStream->StreamBuffer = SectionStream;\r
   }\r
-  \r
+\r
   //\r
   // Initialize the rest of the section stream\r
   //\r
@@ -384,7 +384,7 @@ OpenSectionStreamEx (
   NewStream->StreamLength = SectionStreamLength;\r
   InitializeListHead (&NewStream->Children);\r
   NewStream->AuthenticationStatus = AuthenticationStatus;\r
-  \r
+\r
   //\r
   // Add new stream to stream list\r
   //\r
@@ -393,7 +393,7 @@ OpenSectionStreamEx (
   gBS->RestoreTPL (OldTpl);\r
 \r
   *SectionStreamHandle = NewStream->StreamHandle;\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -428,9 +428,9 @@ OpenSectionStream (
   if (!IsValidSectionStream (SectionStream, SectionStreamLength)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
-  return OpenSectionStreamEx ( \r
-          SectionStreamLength, \r
+\r
+  return OpenSectionStreamEx (\r
+          SectionStreamLength,\r
           SectionStream,\r
           TRUE,\r
           0,\r
@@ -460,7 +460,7 @@ ChildIsType (
   )\r
 {\r
   EFI_GUID_DEFINED_SECTION    *GuidedSection;\r
-  \r
+\r
   if (SearchType == EFI_SECTION_ALL) {\r
     return TRUE;\r
   }\r
@@ -549,7 +549,7 @@ CreateProtocolNotifyEvent (
 \r
   @return TRUE      The GuidedSectionGuid could be identified, and the pointer to\r
                     the Guided Section Extraction Protocol will be returned to *GuidedSectionExtraction.\r
-  @return FALSE     The GuidedSectionGuid could not be identified, or \r
+  @return FALSE     The GuidedSectionGuid could not be identified, or\r
                     the Guided Section Extraction Protocol has not been installed yet.\r
 \r
 **/\r
@@ -588,7 +588,7 @@ VerifyGuidedSectionGuid (
 }\r
 \r
 /**\r
-  RPN callback function.  \r
+  RPN callback function.\r
   1. Initialize the section stream when the GUIDED_SECTION_EXTRACTION_PROTOCOL is installed.\r
   2. Removes a stale section stream and re-initializes it with an updated AuthenticationStatus.\r
 \r
@@ -611,7 +611,7 @@ NotifyGuidedExtraction (
   UINTN                                   NewStreamBufferSize;\r
   UINT32                                  AuthenticationStatus;\r
   RPN_EVENT_CONTEXT                       *Context;\r
-  \r
+\r
   Context = RpnContext;\r
   Status = EFI_SUCCESS;\r
   if (Context->ChildNode->EncapsulatedStreamHandle != NULL_STREAM_HANDLE) {\r
@@ -619,14 +619,14 @@ NotifyGuidedExtraction (
   }\r
   if (!EFI_ERROR (Status)) {\r
     //\r
-    // The stream is not initialized, open it. \r
+    // The stream is not initialized, open it.\r
     // Or the stream closed successfully, so re-open the stream with correct AuthenticationStatus.\r
     //\r
-  \r
-    GuidedHeader = (EFI_GUID_DEFINED_SECTION *) \r
+\r
+    GuidedHeader = (EFI_GUID_DEFINED_SECTION *)\r
       (Context->ParentStream->StreamBuffer + Context->ChildNode->OffsetInStream);\r
     ASSERT (GuidedHeader->CommonHeader.Type == EFI_SECTION_GUID_DEFINED);\r
-    \r
+\r
     if (!VerifyGuidedSectionGuid (Context->ChildNode->EncapsulationGuid, &GuidedExtraction)) {\r
       return;\r
     }\r
@@ -658,11 +658,11 @@ NotifyGuidedExtraction (
   //  already been closed by someone, so just destroy the event and be done with\r
   //  it.\r
   //\r
-  \r
+\r
   gBS->CloseEvent (Event);\r
   Context->ChildNode->Event = NULL;\r
   FreePool (Context);\r
-}  \r
+}\r
 \r
 /**\r
   Worker function.  Constructor for RPN event if needed to keep AuthenticationStatus\r
@@ -679,16 +679,16 @@ CreateGuidedExtractionRpnEvent (
   )\r
 {\r
   RPN_EVENT_CONTEXT *Context;\r
-  \r
+\r
   //\r
   // Allocate new event structure and context\r
   //\r
   Context = AllocatePool (sizeof (RPN_EVENT_CONTEXT));\r
   ASSERT (Context != NULL);\r
-  \r
+\r
   Context->ChildNode = ChildNode;\r
   Context->ParentStream = ParentStream;\r
\r
+\r
   Context->ChildNode->Event = CreateProtocolNotifyEvent (\r
                                 Context->ChildNode->EncapsulationGuid,\r
                                 TPL_NOTIFY,\r
@@ -740,7 +740,7 @@ CreateChildNode (
   UINT32                                       UncompressedLength;\r
   UINT8                                        CompressionType;\r
   UINT16                                       GuidedSectionAttributes;\r
-    \r
+\r
   FRAMEWORK_SECTION_CHILD_NODE                      *Node;\r
 \r
   SectionHeader = (EFI_COMMON_SECTION_HEADER *) (Stream->StreamBuffer + ChildOffset);\r
@@ -753,7 +753,7 @@ CreateChildNode (
   if (Node == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // Now initialize it\r
   //\r
@@ -767,7 +767,7 @@ CreateChildNode (
   Node->OffsetInStream = ChildOffset;\r
   Node->EncapsulatedStreamHandle = NULL_STREAM_HANDLE;\r
   Node->EncapsulationGuid = NULL;\r
-  \r
+\r
   //\r
   // If it's an encapsulating section, then create the new section stream also\r
   //\r
@@ -805,7 +805,7 @@ CreateChildNode (
           FreePool (Node);\r
           return EFI_OUT_OF_RESOURCES;\r
         }\r
-        \r
+\r
         if (CompressionType == EFI_NOT_COMPRESSED) {\r
           //\r
           // stream is not actually compressed, just encapsulated.  So just copy it.\r
@@ -814,15 +814,15 @@ CreateChildNode (
         } else if (CompressionType == EFI_STANDARD_COMPRESSION) {\r
           //\r
           // Only support the EFI_SATNDARD_COMPRESSION algorithm.\r
-          // \r
+          //\r
 \r
           //\r
           // Decompress the stream\r
           //\r
           Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress);\r
-          \r
+\r
           ASSERT_EFI_ERROR (Status);\r
-          \r
+\r
           Status = Decompress->GetInfo (\r
                                  Decompress,\r
                                  CompressionSource,\r
@@ -855,7 +855,7 @@ CreateChildNode (
                                  ScratchBuffer,\r
                                  ScratchSize\r
                                  );\r
-          FreePool (ScratchBuffer); \r
+          FreePool (ScratchBuffer);\r
           if (EFI_ERROR (Status)) {\r
             FreePool (Node);\r
             FreePool (NewStreamBuffer);\r
@@ -866,7 +866,7 @@ CreateChildNode (
         NewStreamBuffer = NULL;\r
         NewStreamBufferSize = 0;\r
       }\r
-      \r
+\r
       Status = OpenSectionStreamEx (\r
                  NewStreamBufferSize,\r
                  NewStreamBuffer,\r
@@ -906,9 +906,9 @@ CreateChildNode (
           FreePool (*ChildNode);\r
           return EFI_PROTOCOL_ERROR;\r
         }\r
-        \r
+\r
         //\r
-        // Make sure we initialize the new stream with the correct \r
+        // Make sure we initialize the new stream with the correct\r
         // authentication status for both aggregate and local status fields.\r
         //\r
         if ((GuidedSectionAttributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) == EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {\r
@@ -923,7 +923,7 @@ CreateChildNode (
           //\r
           AuthenticationStatus = Stream->AuthenticationStatus;\r
         }\r
-        \r
+\r
         Status = OpenSectionStreamEx (\r
                    NewStreamBufferSize,\r
                    NewStreamBuffer,\r
@@ -942,8 +942,8 @@ CreateChildNode (
         //\r
         if ((GuidedSectionAttributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) == EFI_GUIDED_SECTION_PROCESSING_REQUIRED) {\r
           //\r
-          // If the section REQUIRES an extraction protocol, register for RPN \r
-          // when the required GUIDed extraction protocol becomes available. \r
+          // If the section REQUIRES an extraction protocol, register for RPN\r
+          // when the required GUIDed extraction protocol becomes available.\r
           //\r
           AuthenticationStatus = 0;\r
           CreateGuidedExtractionRpnEvent (Stream, Node);\r
@@ -954,11 +954,11 @@ CreateChildNode (
           AuthenticationStatus = Stream->AuthenticationStatus;\r
           if ((GuidedSectionAttributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) == EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {\r
             //\r
-            //  The local status of the new stream is contained in \r
+            //  The local status of the new stream is contained in\r
             //  AuthenticaionStatus.  This value needs to be ORed into the\r
             //  Aggregate bits also...\r
             //\r
-            \r
+\r
             //\r
             // Clear out and initialize the local status\r
             //\r
@@ -969,7 +969,7 @@ CreateChildNode (
             //\r
             AuthenticationStatus |= AuthenticationStatus >> 16;\r
           }\r
-          \r
+\r
           if (IS_SECTION2 (GuidedHeader)) {\r
             Status = OpenSectionStreamEx (\r
                        SECTION2_SIZE (GuidedHeader) - ((EFI_GUID_DEFINED_SECTION2 *) GuidedHeader)->DataOffset,\r
@@ -993,8 +993,8 @@ CreateChildNode (
           }\r
         }\r
       }\r
-      \r
-      if ((AuthenticationStatus & EFI_LOCAL_AUTH_STATUS_ALL) == \r
+\r
+      if ((AuthenticationStatus & EFI_LOCAL_AUTH_STATUS_ALL) ==\r
             (EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED | EFI_LOCAL_AUTH_STATUS_NOT_TESTED)) {\r
         //\r
         // Need to register for RPN for when the required GUIDed extraction\r
@@ -1004,17 +1004,17 @@ CreateChildNode (
         //\r
         CreateGuidedExtractionRpnEvent (Stream, Node);\r
       }\r
-      \r
+\r
       break;\r
 \r
     default:\r
-      \r
+\r
       //\r
       // Nothing to do if it's a leaf\r
       //\r
       break;\r
   }\r
-  \r
+\r
   //\r
   // Last, add the new child node to the stream\r
   //\r
@@ -1064,15 +1064,15 @@ FindChildNode (
   UINT32                                        NextChildOffset;\r
   EFI_STATUS                                    ErrorStatus;\r
   EFI_STATUS                                    Status;\r
-  \r
+\r
   CurrentChildNode = NULL;\r
   ErrorStatus = EFI_NOT_FOUND;\r
-  \r
+\r
   if (SourceStream->StreamLength == 0) {\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
-  if (IsListEmpty (&SourceStream->Children) && \r
+\r
+  if (IsListEmpty (&SourceStream->Children) &&\r
                    SourceStream->StreamLength >= sizeof (EFI_COMMON_SECTION_HEADER)) {\r
     //\r
     // This occurs when a section stream exists, but no child sections\r
@@ -1086,7 +1086,7 @@ FindChildNode (
       return Status;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // At least one child has been parsed out of the section stream.  So, walk\r
   // through the sections that have already been parsed out looking for the\r
@@ -1113,7 +1113,7 @@ FindChildNode (
         return EFI_SUCCESS;\r
       }\r
     }\r
-    \r
+\r
     if (CurrentChildNode->EncapsulatedStreamHandle != NULL_STREAM_HANDLE) {\r
       //\r
       // If the current node is an encapsulating node, recurse into it...\r
@@ -1147,7 +1147,7 @@ FindChildNode (
       //\r
       ErrorStatus = EFI_PROTOCOL_ERROR;\r
     }\r
-    \r
+\r
     if (!IsNodeAtEnd (&SourceStream->Children, &CurrentChildNode->Link)) {\r
       //\r
       // We haven't found the child node we're interested in yet, but there's\r
@@ -1199,9 +1199,9 @@ FindStreamNode (
   IN  UINTN                                     SearchHandle,\r
   OUT FRAMEWORK_SECTION_STREAM_NODE                  **FoundStream\r
   )\r
-{  \r
+{\r
   FRAMEWORK_SECTION_STREAM_NODE                      *StreamNode;\r
-  \r
+\r
   if (!IsListEmpty (&mStreamRoot)) {\r
     StreamNode = STREAM_NODE_FROM_LINK (GetFirstNode (&mStreamRoot));\r
     for (;;) {\r
@@ -1215,10 +1215,10 @@ FindStreamNode (
       }\r
     }\r
   }\r
-  \r
+\r
   return EFI_NOT_FOUND;\r
 }\r
-  \r
+\r
 /**\r
   SEP member function.  Retrieves requested section from section stream.\r
 \r
@@ -1242,22 +1242,22 @@ FindStreamNode (
   @param AuthenticationStatus  Indicates the authentication status of the retrieved\r
                                section.\r
 \r
\r
+\r
   @retval EFI_SUCCESS           Section was retrieved successfully\r
-  @retval EFI_PROTOCOL_ERROR    A GUID defined section was encountered in the section \r
+  @retval EFI_PROTOCOL_ERROR    A GUID defined section was encountered in the section\r
                                 stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED\r
-                                bit set, but there was no corresponding GUIDed Section \r
-                                Extraction Protocol in the handle database.  *Buffer is \r
+                                bit set, but there was no corresponding GUIDed Section\r
+                                Extraction Protocol in the handle database.  *Buffer is\r
                                 unmodified.\r
   @retval EFI_NOT_FOUND         An error was encountered when parsing the SectionStream.\r
-                                This indicates the SectionStream  is not correctly \r
+                                This indicates the SectionStream  is not correctly\r
                                 formatted.\r
   @retval EFI_NOT_FOUND         The requested section does not exist.\r
-  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process the \r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process the\r
                                 request.\r
   @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
-  @retval EFI_WARN_TOO_SMALL    The size of the caller allocated input buffer is \r
-                                insufficient to contain the requested section.  The \r
+  @retval EFI_WARN_TOO_SMALL    The size of the caller allocated input buffer is\r
+                                insufficient to contain the requested section.  The\r
                                 input buffer is filled and contents are section contents\r
                                 are truncated.\r
 \r
@@ -1286,12 +1286,12 @@ GetSection (
   UINT8                                                 *CopyBuffer;\r
   UINTN                                                 SectionSize;\r
   EFI_COMMON_SECTION_HEADER                             *Section;\r
-  \r
+\r
 \r
   OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
   Instance = SectionInstance + 1;\r
   ChildStreamNode = NULL;\r
-  \r
+\r
   //\r
   // Locate target stream\r
   //\r
@@ -1300,7 +1300,7 @@ GetSection (
     Status = EFI_INVALID_PARAMETER;\r
     goto GetSection_Done;\r
   }\r
-  \r
+\r
   //\r
   // Found the stream, now locate and return the appropriate section\r
   //\r
@@ -1316,12 +1316,12 @@ GetSection (
     // There's a requested section type, so go find it and return it...\r
     //\r
     Status = FindChildNode (\r
-                      StreamNode, \r
-                      *SectionType, \r
-                      &Instance, \r
+                      StreamNode,\r
+                      *SectionType,\r
+                      &Instance,\r
                       SectionDefinitionGuid,\r
                       &ChildNode,\r
-                      &ChildStreamNode, \r
+                      &ChildStreamNode,\r
                       &ExtractedAuthenticationStatus\r
                       );\r
     if (EFI_ERROR (Status)) {\r
@@ -1339,9 +1339,9 @@ GetSection (
       CopyBuffer = (UINT8 *) Section + sizeof (EFI_COMMON_SECTION_HEADER);\r
     }\r
     *AuthenticationStatus = ExtractedAuthenticationStatus;\r
-  }   \r
-    \r
-  SectionSize = CopySize;  \r
+  }\r
+\r
+  SectionSize = CopySize;\r
   if (*Buffer != NULL) {\r
     //\r
     // Caller allocated buffer.  Fill to size and return required size...\r
@@ -1362,7 +1362,7 @@ GetSection (
   }\r
   CopyMem (*Buffer, CopyBuffer, CopySize);\r
   *BufferSize = SectionSize;\r
-  \r
+\r
 GetSection_Done:\r
   gBS->RestoreTPL (OldTpl);\r
   return Status;\r
@@ -1384,7 +1384,7 @@ FreeChildNode (
   // Remove the child from it's list\r
   //\r
   RemoveEntryList (&ChildNode->Link);\r
-  \r
+\r
   if (ChildNode->EncapsulatedStreamHandle != NULL_STREAM_HANDLE) {\r
     //\r
     // If it's an encapsulating section, we close the resulting section stream.\r
@@ -1401,7 +1401,7 @@ FreeChildNode (
   // Last, free the child node itself\r
   //\r
   FreePool (ChildNode);\r
-}  \r
+}\r
 \r
 /**\r
   SEP member function.  Deletes an existing section stream\r
@@ -1427,9 +1427,9 @@ CloseSectionStream (
   EFI_STATUS                                    Status;\r
   LIST_ENTRY                                    *Link;\r
   FRAMEWORK_SECTION_CHILD_NODE                       *ChildNode;\r
-  \r
+\r
   OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-  \r
+\r
   //\r
   // Locate target stream\r
   //\r
@@ -1450,7 +1450,7 @@ CloseSectionStream (
   } else {\r
     Status = EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   gBS->RestoreTPL (OldTpl);\r
   return Status;\r
 }\r