]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / SmbiosDxe / SmbiosDxe.c
index 4e757e1c47c0e16512c5825c5f24be4e245ca163..78955f3a56ad5a25961d42bda0f53196b570fb1d 100644 (file)
@@ -1,15 +1,15 @@
 /** @file\r
-  This code produces the Smbios protocol. It also responsible for constructing \r
+  This code produces the Smbios protocol. It also responsible for constructing\r
   SMBIOS table into system table.\r
-  \r
-Copyright (c) 2009 - 2017, 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
+\r
+Copyright (c) 2009 - 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
+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
 \r
 **/\r
 \r
@@ -165,7 +165,7 @@ SMBIOS_TABLE_3_0_ENTRY_POINT Smbios30EntryPointStructureData = {
 \r
   @retval EFI_SUCCESS           Size retured in Size.\r
   @retval EFI_INVALID_PARAMETER Input SMBIOS structure mal-formed or Size is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -180,7 +180,7 @@ GetSmbiosStructureSize (
   UINTN  StrLen;\r
   UINTN  MaxLen;\r
   INT8*  CharInStr;\r
-  \r
+\r
   if (Size == NULL || NumberOfStrings == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -193,7 +193,7 @@ GetSmbiosStructureSize (
   //\r
   // look for the two consecutive zeros, check the string limit by the way.\r
   //\r
-  while (*CharInStr != 0 || *(CharInStr+1) != 0) { \r
+  while (*CharInStr != 0 || *(CharInStr+1) != 0) {\r
     if (*CharInStr == 0) {\r
       *Size += 1;\r
       CharInStr++;\r
@@ -251,7 +251,7 @@ GetSmbiosStructureSize (
 \r
   @retval TRUE       Smbios handle already in use.\r
   @retval FALSE      Smbios handle is NOT used.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
@@ -262,7 +262,7 @@ CheckSmbiosHandleExistance (
 {\r
   LIST_ENTRY              *Link;\r
   SMBIOS_HANDLE_ENTRY     *HandleEntry;\r
-  \r
+\r
   for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {\r
     HandleEntry = SMBIOS_HANDLE_ENTRY_FROM_LINK(Link);\r
     if (HandleEntry->SmbiosHandle == Handle) {\r
@@ -286,7 +286,7 @@ EFIAPI
 GetMaxSmbiosHandle (\r
   IN CONST  EFI_SMBIOS_PROTOCOL   *This,\r
   IN OUT    EFI_SMBIOS_HANDLE     *MaxHandle\r
-  ) \r
+  )\r
 {\r
   if (This->MajorVersion == 2 && This->MinorVersion == 0) {\r
     *MaxHandle = 0xFFFE;\r
@@ -304,7 +304,7 @@ GetMaxSmbiosHandle (
 \r
   @retval EFI_SUCCESS            Smbios handle got.\r
   @retval EFI_OUT_OF_RESOURCES   Smbios handle is NOT available.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -343,8 +343,8 @@ GetAvailableSmbiosHandle (
                                 will be assigned to the SMBIOS record. If the SMBIOS handle is already in use,\r
                                 EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.\r
   @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
-                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
-                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
+                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined\r
+                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or\r
                                 a set of null terminated strings and a null.\r
 \r
   @retval EFI_SUCCESS           Record was added.\r
@@ -375,11 +375,11 @@ SmbiosAdd (
   EFI_SMBIOS_RECORD_HEADER    *InternalRecord;\r
   BOOLEAN                     Smbios32BitTable;\r
   BOOLEAN                     Smbios64BitTable;\r
-  \r
+\r
   if (SmbiosHandle == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   Private = SMBIOS_INSTANCE_FROM_THIS (This);\r
   //\r
   // Check whether SmbiosHandle is already in use\r
@@ -417,14 +417,14 @@ SmbiosAdd (
 \r
   Smbios32BitTable = FALSE;\r
   Smbios64BitTable = FALSE;\r
-  if ((This->MajorVersion < 0x3) || \r
+  if ((This->MajorVersion < 0x3) ||\r
       ((This->MajorVersion >= 0x3) && ((PcdGet32 (PcdSmbiosEntryPointProvideMethod) & BIT0) == BIT0))) {\r
     //\r
     // For SMBIOS 32-bit table, the length of the entire structure table (including all strings) must be reported\r
     // in the Structure Table Length field of the SMBIOS Structure Table Entry Point,\r
     // which is a WORD field limited to 65,535 bytes. So the max size of 32-bit table should not exceed 65,535 bytes.\r
     //\r
-    if ((EntryPointStructure != NULL) && \r
+    if ((EntryPointStructure != NULL) &&\r
         (EntryPointStructure->TableLength + StructureSize > SMBIOS_TABLE_MAX_LENGTH)) {\r
       DEBUG ((EFI_D_INFO, "SmbiosAdd: Total length exceeds max 32-bit table length with type = %d size = 0x%x\n", Record->Type, StructureSize));\r
     } else {\r
@@ -432,7 +432,7 @@ SmbiosAdd (
       DEBUG ((EFI_D_INFO, "SmbiosAdd: Smbios type %d with size 0x%x is added to 32-bit table\n", Record->Type, StructureSize));\r
     }\r
   }\r
-  \r
+\r
   //\r
   // For SMBIOS 3.0, Structure table maximum size in Entry Point structure is DWORD field limited to 0xFFFFFFFF bytes.\r
   //\r
@@ -441,7 +441,7 @@ SmbiosAdd (
     // For SMBIOS 64-bit table, Structure table maximum size in SMBIOS 3.0 (64-bit) Entry Point\r
     // is a DWORD field limited to 0xFFFFFFFF bytes. So the max size of 64-bit table should not exceed 0xFFFFFFFF bytes.\r
     //\r
-    if ((Smbios30EntryPointStructure != NULL) && \r
+    if ((Smbios30EntryPointStructure != NULL) &&\r
         (Smbios30EntryPointStructure->TableMaximumSize + StructureSize > SMBIOS_3_0_TABLE_MAX_LENGTH)) {\r
       DEBUG ((EFI_D_INFO, "SmbiosAdd: Total length exceeds max 64-bit table length with type = %d size = 0x%x\n", Record->Type, StructureSize));\r
     } else {\r
@@ -459,12 +459,12 @@ SmbiosAdd (
 \r
   //\r
   // Enter into critical section\r
-  //  \r
+  //\r
   Status = EfiAcquireLockOrFail (&Private->DataLock);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   RecordSize  = sizeof (EFI_SMBIOS_RECORD_HEADER) + StructureSize;\r
   TotalSize   = sizeof (EFI_SMBIOS_ENTRY) + RecordSize;\r
 \r
@@ -520,7 +520,7 @@ SmbiosAdd (
   // configuration table without depending on PI SMBIOS protocol.\r
   //\r
   SmbiosTableConstruction (Smbios32BitTable, Smbios64BitTable);\r
-  \r
+\r
   //\r
   // Leave critical section\r
   //\r
@@ -567,7 +567,7 @@ SmbiosUpdateString (
   EFI_SMBIOS_HANDLE         MaxSmbiosHandle;\r
   EFI_SMBIOS_TABLE_HEADER   *Record;\r
   EFI_SMBIOS_RECORD_HEADER  *InternalRecord;\r
-  \r
+\r
   //\r
   // Check args validity\r
   //\r
@@ -594,7 +594,7 @@ SmbiosUpdateString (
   } else if (This->MajorVersion < 3) {\r
     //\r
     // Reference SMBIOS 2.7, chapter 6.1.3, it will have no limit on the length of each individual text string.\r
-    // However, the length of the entire structure table (including all strings) must be reported \r
+    // However, the length of the entire structure table (including all strings) must be reported\r
     // in the Structure Table Length field of the SMBIOS Structure Table Entry Point,\r
     // which is a WORD field limited to 65,535 bytes.\r
     //\r
@@ -606,7 +606,7 @@ SmbiosUpdateString (
       //\r
       // SMBIOS 3.0 defines the Structure table maximum size as DWORD field limited to 0xFFFFFFFF bytes.\r
       // The input string length should not exceed 0xFFFFFFFF bytes.\r
-      // \r
+      //\r
       return EFI_UNSUPPORTED;\r
     }\r
   }\r
@@ -614,7 +614,7 @@ SmbiosUpdateString (
   Private = SMBIOS_INSTANCE_FROM_THIS (This);\r
   //\r
   // Enter into critical section\r
-  //  \r
+  //\r
   Status = EfiAcquireLockOrFail (&Private->DataLock);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -637,7 +637,7 @@ SmbiosUpdateString (
       // Point to unformed string section\r
       //\r
       StrStart = (CHAR8 *) Record + Record->Length;\r
-     \r
+\r
       for (StrIndex = 1, TargetStrOffset = 0; StrIndex < *StringNumber; StrStart++, TargetStrOffset++) {\r
         //\r
         // A string ends in 00h\r
@@ -645,21 +645,21 @@ SmbiosUpdateString (
         if (*StrStart == 0) {\r
           StrIndex++;\r
         }\r
-        \r
+\r
         //\r
         // String section ends in double-null (0000h)\r
         //\r
         if (*StrStart == 0 && *(StrStart + 1) == 0) {\r
           EfiReleaseLock (&Private->DataLock);\r
           return EFI_NOT_FOUND;\r
-        } \r
+        }\r
       }\r
 \r
       if (*StrStart == 0) {\r
         StrStart++;\r
         TargetStrOffset++;\r
       }\r
-      \r
+\r
       //\r
       // Now we get the string target\r
       //\r
@@ -676,15 +676,15 @@ SmbiosUpdateString (
         EfiReleaseLock (&Private->DataLock);\r
         return EFI_SUCCESS;\r
       }\r
-      \r
+\r
       SmbiosEntry->Smbios32BitTable = FALSE;\r
       SmbiosEntry->Smbios64BitTable = FALSE;\r
-      if ((This->MajorVersion < 0x3) || \r
+      if ((This->MajorVersion < 0x3) ||\r
           ((This->MajorVersion >= 0x3) && ((PcdGet32 (PcdSmbiosEntryPointProvideMethod) & BIT0) == BIT0))) {\r
         //\r
         // 32-bit table is produced, check the valid length.\r
         //\r
-        if ((EntryPointStructure != NULL) && \r
+        if ((EntryPointStructure != NULL) &&\r
             (EntryPointStructure->TableLength + InputStrLen - TargetStrLen > SMBIOS_TABLE_MAX_LENGTH)) {\r
           //\r
           // The length of the entire structure table (including all strings) must be reported\r
@@ -696,13 +696,13 @@ SmbiosUpdateString (
           DEBUG ((EFI_D_INFO, "SmbiosUpdateString: New smbios record add to 32-bit table\n"));\r
           SmbiosEntry->Smbios32BitTable = TRUE;\r
         }\r
-      } \r
+      }\r
 \r
       if ((This->MajorVersion >= 0x3) && ((PcdGet32 (PcdSmbiosEntryPointProvideMethod) & BIT1) == BIT1)) {\r
         //\r
         // 64-bit table is produced, check the valid length.\r
         //\r
-        if ((Smbios30EntryPointStructure != NULL) && \r
+        if ((Smbios30EntryPointStructure != NULL) &&\r
             (Smbios30EntryPointStructure->TableMaximumSize + InputStrLen - TargetStrLen > SMBIOS_3_0_TABLE_MAX_LENGTH)) {\r
           DEBUG ((EFI_D_INFO, "SmbiosUpdateString: Total length exceeds max 64-bit table length\n"));\r
         } else {\r
@@ -818,7 +818,7 @@ SmbiosRemove (
   Private = SMBIOS_INSTANCE_FROM_THIS (This);\r
   //\r
   // Enter into critical section\r
-  //  \r
+  //\r
   Status = EfiAcquireLockOrFail (&Private->DataLock);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -833,7 +833,7 @@ SmbiosRemove (
       // Remove specified smobios record from DataList\r
       //\r
       RemoveEntryList(Link);\r
-      // \r
+      //\r
       // Remove this handle from AllocatedHandleList\r
       //\r
       Head = &Private->AllocatedHandleListHead;\r
@@ -872,7 +872,7 @@ SmbiosRemove (
   //\r
   EfiReleaseLock (&Private->DataLock);\r
   return EFI_INVALID_PARAMETER;\r
-  \r
+\r
 }\r
 \r
 /**\r
@@ -882,13 +882,13 @@ SmbiosRemove (
   @param  SmbiosHandle          On entry, points to the previous handle of the SMBIOS record. On exit, points to the\r
                                 next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record\r
                                 handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.\r
-  @param  Type                  On entry it means return the next SMBIOS record of type Type. If a NULL is passed in \r
+  @param  Type                  On entry it means return the next SMBIOS record of type Type. If a NULL is passed in\r
                                 this functionally it ignored. Type is not modified by the GetNext() function.\r
   @param  Record                On exit, points to the SMBIOS Record consisting of the formatted area followed by\r
                                 the unformatted area. The unformatted area optionally contains text strings.\r
-  @param  ProducerHandle        On exit, points to the ProducerHandle registered by Add(). If no ProducerHandle was passed into Add() NULL is returned. \r
-                                If a NULL pointer is passed in no data will be returned \r
-                                \r
+  @param  ProducerHandle        On exit, points to the ProducerHandle registered by Add(). If no ProducerHandle was passed into Add() NULL is returned.\r
+                                If a NULL pointer is passed in no data will be returned\r
+\r
   @retval EFI_SUCCESS           SMBIOS record information was successfully returned in Record.\r
   @retval EFI_NOT_FOUND         The SMBIOS record with SmbiosHandle was the last available record.\r
 \r
@@ -919,14 +919,14 @@ SmbiosGetNext (
   Head = &Private->DataListHead;\r
   for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {\r
     SmbiosEntry = SMBIOS_ENTRY_FROM_LINK(Link);\r
-    SmbiosTableHeader = (EFI_SMBIOS_TABLE_HEADER*)(SmbiosEntry->RecordHeader + 1); \r
+    SmbiosTableHeader = (EFI_SMBIOS_TABLE_HEADER*)(SmbiosEntry->RecordHeader + 1);\r
 \r
     //\r
     // If SmbiosHandle is 0xFFFE, the first matched SMBIOS record handle will be returned\r
     //\r
     if (*SmbiosHandle == SMBIOS_HANDLE_PI_RESERVED) {\r
       if ((Type != NULL) && (*Type != SmbiosTableHeader->Type)) {\r
-        continue;  \r
+        continue;\r
       }\r
 \r
       *SmbiosHandle = SmbiosTableHeader->Handle;\r
@@ -947,33 +947,33 @@ SmbiosGetNext (
 \r
     if (StartPointFound) {\r
       if ((Type != NULL) && (*Type != SmbiosTableHeader->Type)) {\r
-        continue; \r
+        continue;\r
       }\r
-      \r
+\r
       *SmbiosHandle = SmbiosTableHeader->Handle;\r
-      *Record = SmbiosTableHeader; \r
+      *Record = SmbiosTableHeader;\r
       if (ProducerHandle != NULL) {\r
         *ProducerHandle = SmbiosEntry->RecordHeader->ProducerHandle;\r
       }\r
 \r
-      return EFI_SUCCESS;   \r
+      return EFI_SUCCESS;\r
     }\r
   }\r
 \r
   *SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
   return EFI_NOT_FOUND;\r
-  \r
+\r
 }\r
 \r
 /**\r
   Allow the caller to discover all of the SMBIOS records.\r
 \r
   @param  This                  The EFI_SMBIOS_PROTOCOL instance.\r
-  @param  CurrentSmbiosEntry    On exit, points to the SMBIOS entry on the list which includes the returned SMBIOS record information. \r
-                                If *CurrentSmbiosEntry is NULL on entry, then the first SMBIOS entry on the list will be returned. \r
+  @param  CurrentSmbiosEntry    On exit, points to the SMBIOS entry on the list which includes the returned SMBIOS record information.\r
+                                If *CurrentSmbiosEntry is NULL on entry, then the first SMBIOS entry on the list will be returned.\r
   @param  Record                On exit, points to the SMBIOS Record consisting of the formatted area followed by\r
                                 the unformatted area. The unformatted area optionally contains text strings.\r
-                                \r
+\r
   @retval EFI_SUCCESS           SMBIOS record information was successfully returned in Record.\r
                                 *CurrentSmbiosEntry points to the SMBIOS entry which includes the returned SMBIOS record information.\r
   @retval EFI_NOT_FOUND         There is no more SMBIOS entry.\r
@@ -1005,32 +1005,32 @@ GetNextSmbiosRecord (
     //\r
     Head = &(*CurrentSmbiosEntry)->Link;\r
   }\r
-  \r
+\r
   Link  = Head->ForwardLink;\r
-  \r
+\r
   if (Link == &Private->DataListHead) {\r
     //\r
     // If no more SMBIOS entry in the list, return not found.\r
     //\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
+\r
   SmbiosEntry = SMBIOS_ENTRY_FROM_LINK(Link);\r
   SmbiosTableHeader = (EFI_SMBIOS_TABLE_HEADER*)(SmbiosEntry->RecordHeader + 1);\r
-  *Record = SmbiosTableHeader; \r
+  *Record = SmbiosTableHeader;\r
   *CurrentSmbiosEntry = SmbiosEntry;\r
-  return EFI_SUCCESS;   \r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
   Assembles SMBIOS table from the SMBIOS protocol. Produce Table\r
   Entry Point and return the pointer to it.\r
-  \r
+\r
   @param  TableEntryPointStructure   On exit, points to the SMBIOS entrypoint structure.\r
-                                \r
+\r
   @retval EFI_SUCCESS                Structure created sucessfully.\r
   @retval EFI_OUT_OF_RESOURCES       No enough memory.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1048,7 +1048,7 @@ SmbiosCreateTable (
   EFI_SMBIOS_TABLE_HEADER         *SmbiosRecord;\r
   EFI_SMBIOS_TABLE_END_STRUCTURE  EndStructure;\r
   EFI_SMBIOS_ENTRY                *CurrentSmbiosEntry;\r
-  \r
+\r
   Status            = EFI_SUCCESS;\r
   BufferPointer     = NULL;\r
 \r
@@ -1081,9 +1081,9 @@ SmbiosCreateTable (
         return EFI_OUT_OF_RESOURCES;\r
       }\r
     }\r
-    \r
+\r
     EntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) (UINTN) PhysicalAddress;\r
-    \r
+\r
     CopyMem (\r
       EntryPointStructure,\r
       &EntryPointStructureData,\r
@@ -1109,7 +1109,7 @@ SmbiosCreateTable (
   CurrentSmbiosEntry = NULL;\r
   do {\r
     Status = GetNextSmbiosRecord (SmbiosProtocol, &CurrentSmbiosEntry, &SmbiosRecord);\r
-                               \r
+\r
     if ((Status == EFI_SUCCESS) && (CurrentSmbiosEntry->Smbios32BitTable)) {\r
       GetSmbiosStructureSize(SmbiosProtocol, SmbiosRecord, &RecordSize, &NumOfStr);\r
       //\r
@@ -1122,7 +1122,7 @@ SmbiosCreateTable (
       }\r
     }\r
   } while (!EFI_ERROR(Status));\r
-  \r
+\r
   //\r
   // Create End-Of-Table structure\r
   //\r
@@ -1140,15 +1140,15 @@ SmbiosCreateTable (
 \r
   if (EFI_SIZE_TO_PAGES ((UINT32) EntryPointStructure->TableLength) > mPreAllocatedPages) {\r
     //\r
-    // If new SMBIOS table size exceeds the previous allocated page, \r
+    // If new SMBIOS table size exceeds the previous allocated page,\r
     // it is time to re-allocate memory (below 4GB).\r
-    // \r
+    //\r
     DEBUG ((EFI_D_INFO, "%a() re-allocate SMBIOS 32-bit table\n",\r
       __FUNCTION__));\r
     if (EntryPointStructure->TableAddress != 0) {\r
       //\r
       // Free the previous allocated page\r
-      //      \r
+      //\r
       FreePages (\r
             (VOID*)(UINTN)EntryPointStructure->TableAddress,\r
             mPreAllocatedPages\r
@@ -1156,7 +1156,7 @@ SmbiosCreateTable (
       EntryPointStructure->TableAddress = 0;\r
       mPreAllocatedPages = 0;\r
     }\r
-    \r
+\r
     PhysicalAddress = 0xffffffff;\r
     Status = gBS->AllocatePages (\r
                     AllocateMaxAddress,\r
@@ -1173,7 +1173,7 @@ SmbiosCreateTable (
       mPreAllocatedPages = EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength);\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Assemble the tables\r
   //\r
@@ -1189,7 +1189,7 @@ SmbiosCreateTable (
       BufferPointer = BufferPointer + RecordSize;\r
     }\r
   } while (!EFI_ERROR(Status));\r
-  \r
+\r
   //\r
   // Assemble End-Of-Table structure\r
   //\r
@@ -1240,7 +1240,7 @@ SmbiosCreate64BitTable (
   EFI_SMBIOS_TABLE_HEADER         *SmbiosRecord;\r
   EFI_SMBIOS_TABLE_END_STRUCTURE  EndStructure;\r
   EFI_SMBIOS_ENTRY                *CurrentSmbiosEntry;\r
-  \r
+\r
   Status            = EFI_SUCCESS;\r
   BufferPointer     = NULL;\r
 \r
@@ -1264,9 +1264,9 @@ SmbiosCreate64BitTable (
       DEBUG ((EFI_D_ERROR, "SmbiosCreate64BitTable() could not allocate Smbios30EntryPointStructure\n"));\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
-    \r
+\r
     Smbios30EntryPointStructure = (SMBIOS_TABLE_3_0_ENTRY_POINT *) (UINTN) PhysicalAddress;\r
-    \r
+\r
     CopyMem (\r
       Smbios30EntryPointStructure,\r
       &Smbios30EntryPointStructureData,\r
@@ -1286,7 +1286,7 @@ SmbiosCreate64BitTable (
   CurrentSmbiosEntry = NULL;\r
   do {\r
     Status = GetNextSmbiosRecord (SmbiosProtocol, &CurrentSmbiosEntry, &SmbiosRecord);\r
-                               \r
+\r
     if ((Status == EFI_SUCCESS) && (CurrentSmbiosEntry->Smbios64BitTable)) {\r
       GetSmbiosStructureSize(SmbiosProtocol, SmbiosRecord, &RecordSize, &NumOfStr);\r
       //\r
@@ -1309,7 +1309,7 @@ SmbiosCreate64BitTable (
 \r
   if (EFI_SIZE_TO_PAGES (Smbios30EntryPointStructure->TableMaximumSize) > mPre64BitAllocatedPages) {\r
     //\r
-    // If new SMBIOS table size exceeds the previous allocated page, \r
+    // If new SMBIOS table size exceeds the previous allocated page,\r
     // it is time to re-allocate memory at anywhere.\r
     //\r
     DEBUG ((EFI_D_INFO, "%a() re-allocate SMBIOS 64-bit table\n",\r
@@ -1317,7 +1317,7 @@ SmbiosCreate64BitTable (
     if (Smbios30EntryPointStructure->TableAddress != 0) {\r
       //\r
       // Free the previous allocated page\r
-      //      \r
+      //\r
       FreePages (\r
             (VOID*)(UINTN)Smbios30EntryPointStructure->TableAddress,\r
             mPre64BitAllocatedPages\r
@@ -1383,7 +1383,7 @@ SmbiosCreate64BitTable (
 \r
 /**\r
   Create Smbios Table and installs the Smbios Table to the System Table.\r
-  \r
+\r
   @param  Smbios32BitTable    The flag to update 32-bit table.\r
   @param  Smbios64BitTable    The flag to update 64-bit table.\r
 \r
@@ -1416,7 +1416,7 @@ SmbiosTableConstruction (
 \r
 /**\r
 \r
-  Driver to produce Smbios protocol and pre-allocate 1 page for the final SMBIOS table. \r
+  Driver to produce Smbios protocol and pre-allocate 1 page for the final SMBIOS table.\r
 \r
   @param ImageHandle     Module's image handle\r
   @param SystemTable     Pointer of EFI_SYSTEM_TABLE\r
@@ -1445,7 +1445,7 @@ SmbiosDriverEntryPoint (
   InitializeListHead (&mPrivateData.DataListHead);\r
   InitializeListHead (&mPrivateData.AllocatedHandleListHead);\r
   EfiInitializeLock (&mPrivateData.DataLock, TPL_NOTIFY);\r
-  \r
+\r
   //\r
   // Make a new handle and install the protocol\r
   //\r