]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / ConfigKeywordHandler.c
index 5d5f17fb1779f09fb77a7771b47e2f53786180e5..5ee866fb9ecd87a36083f54bf2a608ffce7f2df6 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
 Implementation of interfaces function for EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL.\r
 \r
-Copyright (c) 2015 - 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
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -109,7 +103,7 @@ ExtractDevicePath (
   if (((Length + 1) / 2) < sizeof (EFI_DEVICE_PATH_PROTOCOL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // The data in <PathHdr> is encoded as hex UNICODE %02x bytes in the same order\r
   // as the device path resides in RAM memory.\r
@@ -119,7 +113,7 @@ ExtractDevicePath (
   if (DevicePathBuffer == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // Convert DevicePath\r
   //\r
@@ -133,7 +127,7 @@ ExtractDevicePath (
       DevicePathBuffer [Index/2] = (UINT8) ((DevicePathBuffer [Index/2] << 4) + DigitUint8);\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Validate DevicePath\r
   //\r
@@ -209,7 +203,7 @@ ExtractNameSpace (
 \r
   TmpPtr = StrStr (String, L"&");\r
   if (TmpPtr != NULL) {\r
-    *TmpPtr = 0; \r
+    *TmpPtr = 0;\r
   }\r
   if (NextString != NULL) {\r
     *NextString = String + StrLen (String);\r
@@ -227,7 +221,7 @@ ExtractNameSpace (
   UnicodeStrToAsciiStrS (String, *NameSpace, NameSpaceSize);\r
 \r
   if (TmpPtr != NULL) {\r
-    *TmpPtr = L'&'; \r
+    *TmpPtr = L'&';\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -256,7 +250,7 @@ ExtractKeyword (
   EFI_STRING  TmpPtr;\r
 \r
   ASSERT ((Keyword != NULL) && (NextString != NULL));\r
-  \r
+\r
   TmpPtr = NULL;\r
 \r
   //\r
@@ -280,10 +274,10 @@ ExtractKeyword (
   }\r
 \r
   String += StrLen (L"KEYWORD=");\r
-  \r
+\r
   TmpPtr = StrStr (String, L"&");\r
   if (TmpPtr != NULL) {\r
-    *TmpPtr = 0; \r
+    *TmpPtr = 0;\r
   }\r
   *NextString = String + StrLen (String);\r
 \r
@@ -295,7 +289,7 @@ ExtractKeyword (
   if (TmpPtr != NULL) {\r
     *TmpPtr = L'&';\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -335,10 +329,10 @@ ExtractValue (
   }\r
 \r
   String += StrLen (L"VALUE=");\r
-  \r
+\r
   TmpPtr = StrStr (String, L"&");\r
   if (TmpPtr != NULL) {\r
-    *TmpPtr = 0; \r
+    *TmpPtr = 0;\r
   }\r
   *NextString = String + StrLen (String);\r
 \r
@@ -350,7 +344,7 @@ ExtractValue (
   if (TmpPtr != NULL) {\r
     *TmpPtr = L'&';\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -376,7 +370,7 @@ ExtractFilter (
 {\r
   CHAR16      *PathPtr;\r
   CHAR16      *KeywordPtr;\r
-  BOOLEAN     RetVal; \r
+  BOOLEAN     RetVal;\r
 \r
   ASSERT ((FilterFlags != NULL) && (NextString != NULL));\r
 \r
@@ -387,7 +381,7 @@ ExtractFilter (
     *NextString = NULL;\r
     return FALSE;\r
   }\r
-  \r
+\r
   *FilterFlags = 0;\r
   RetVal = TRUE;\r
 \r
@@ -558,7 +552,7 @@ ValidateFilter (
 \r
   //\r
   // Get ReadOnly flag from Question.\r
-  // \r
+  //\r
   *ReadOnly = ExtractReadOnlyFromOpCode(OpCodeData);\r
 \r
   while (ExtractFilter (StringPtr, &FilterFlags, &NextFilter)) {\r
@@ -653,7 +647,7 @@ ValidateFilter (
     //\r
     StringPtr = NextFilter;\r
   }\r
-  \r
+\r
 Done:\r
   //\r
   // The current filter which is processing.\r
@@ -702,14 +696,14 @@ GetRecordFromDevicePath (
 }\r
 \r
 /**\r
-  Calculate the size of StringSrc and output it. Also copy string text from src \r
+  Calculate the size of StringSrc and output it. Also copy string text from src\r
   to dest.\r
 \r
   This is a internal function.\r
 \r
   @param  StringSrc              Points to current null-terminated string.\r
   @param  BufferSize             Length of the buffer.\r
-  @param  StringDest             Buffer to store the string text. \r
+  @param  StringDest             Buffer to store the string text.\r
 \r
   @retval EFI_SUCCESS            The string text was outputted successfully.\r
   @retval EFI_OUT_OF_RESOURCES   Out of resource.\r
@@ -738,7 +732,7 @@ GetUnicodeStringTextAndSize (
   if (*StringDest == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   CopyMem (*StringDest, StringSrc, StringSize);\r
 \r
   *BufferSize = StringSize;\r
@@ -1067,7 +1061,7 @@ GetNextStringId (
     case EFI_HII_SIBT_STRING_SCSU:\r
       Offset = sizeof (EFI_HII_STRING_BLOCK);\r
       StringTextPtr = BlockHdr + Offset;\r
-      \r
+\r
       if (FindString) {\r
         StringSize = AsciiStrSize ((CHAR8 *) StringTextPtr);\r
         *KeywordValue = AllocatePool (StringSize * sizeof (CHAR16));\r
@@ -1087,7 +1081,7 @@ GetNextStringId (
     case EFI_HII_SIBT_STRING_SCSU_FONT:\r
       Offset = sizeof (EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK) - sizeof (UINT8);\r
       StringTextPtr = BlockHdr + Offset;\r
-      \r
+\r
       if (FindString) {\r
         StringSize = AsciiStrSize ((CHAR8 *) StringTextPtr);\r
         *KeywordValue = AllocatePool (StringSize * sizeof (CHAR16));\r
@@ -1205,7 +1199,7 @@ GetNextStringId (
       BlockSize += Offset;\r
       CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));\r
       for (Index = 0; Index < StringCount; Index++) {\r
-        GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String);        \r
+        GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String);\r
 \r
         if (FindString) {\r
           *KeywordValue = String;\r
@@ -1346,7 +1340,7 @@ GetStringIdFromRecord (
     StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE);\r
 \r
     if (AsciiStrnCmp(Name, StringPackage->StringPkgHdr->Language, AsciiStrLen (Name)) == 0) {\r
-      Status = GetStringIdFromString (StringPackage, KeywordValue, StringId); \r
+      Status = GetStringIdFromString (StringPackage, KeywordValue, StringId);\r
       if (EFI_ERROR (Status)) {\r
         return KEYWORD_HANDLER_KEYWORD_NOT_FOUND;\r
       } else {\r
@@ -1430,10 +1424,10 @@ IsStorageOpCode (
   @retval  the opcode for the question.\r
 \r
 **/\r
-UINT8 * \r
+UINT8 *\r
 FindQuestionFromStringId (\r
   IN HII_IFR_PACKAGE_INSTANCE      *FormPackage,\r
-  IN EFI_STRING_ID                 KeywordStrId \r
+  IN EFI_STRING_ID                 KeywordStrId\r
   )\r
 {\r
   UINT8                        *OpCodeData;\r
@@ -1530,7 +1524,7 @@ FindStorageFromVarId (
   @retval  the width info for one question.\r
 \r
 **/\r
-UINT16 \r
+UINT16\r
 GetWidth (\r
   IN UINT8        *OpCodeData\r
   )\r
@@ -1548,16 +1542,16 @@ GetWidth (
     switch (((EFI_IFR_ONE_OF *) OpCodeData)->Flags & EFI_IFR_NUMERIC_SIZE) {\r
     case EFI_IFR_NUMERIC_SIZE_1:\r
       return (UINT16) sizeof (UINT8);\r
-    \r
+\r
     case EFI_IFR_NUMERIC_SIZE_2:\r
       return  (UINT16) sizeof (UINT16);\r
-    \r
+\r
     case EFI_IFR_NUMERIC_SIZE_4:\r
       return (UINT16) sizeof (UINT32);\r
-    \r
+\r
     case EFI_IFR_NUMERIC_SIZE_8:\r
       return (UINT16) sizeof (UINT64);\r
-    \r
+\r
     default:\r
       ASSERT (FALSE);\r
       return 0;\r
@@ -1572,16 +1566,16 @@ GetWidth (
     switch (((EFI_IFR_ONE_OF_OPTION *) NextOpCodeData)->Type) {\r
     case EFI_IFR_TYPE_NUM_SIZE_8:\r
       return (UINT16) sizeof (UINT8) * ((EFI_IFR_ORDERED_LIST *) OpCodeData)->MaxContainers;\r
-    \r
+\r
     case EFI_IFR_TYPE_NUM_SIZE_16:\r
       return (UINT16) sizeof (UINT16) * ((EFI_IFR_ORDERED_LIST *) OpCodeData)->MaxContainers ;\r
-    \r
+\r
     case EFI_IFR_TYPE_NUM_SIZE_32:\r
       return (UINT16) sizeof (UINT32) * ((EFI_IFR_ORDERED_LIST *) OpCodeData)->MaxContainers;\r
-    \r
+\r
     case EFI_IFR_TYPE_NUM_SIZE_64:\r
       return (UINT16) sizeof (UINT64) * ((EFI_IFR_ORDERED_LIST *) OpCodeData)->MaxContainers;\r
-    \r
+\r
     default:\r
       ASSERT (FALSE);\r
       return 0;\r
@@ -1589,7 +1583,7 @@ GetWidth (
 \r
   case EFI_IFR_CHECKBOX_OP:\r
     return (UINT16) sizeof (BOOLEAN);\r
-    \r
+\r
   case EFI_IFR_PASSWORD_OP:\r
     return (UINT16)((UINTN) ((EFI_IFR_PASSWORD *) OpCodeData)->MaxSize * sizeof (CHAR16));\r
 \r
@@ -1648,12 +1642,12 @@ InternalLowerConfigString (
 \r
 /**\r
   Allocates and returns a Null-terminated Unicode <ConfigHdr> string.\r
-  \r
+\r
   The format of a <ConfigHdr> is as follows:\r
 \r
     GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>\r
 \r
-  @param[in]  OpCodeData    The opcode for the storage.                  \r
+  @param[in]  OpCodeData    The opcode for the storage.\r
   @param[in]  DriverHandle  The driver handle which supports a Device Path Protocol\r
                             that is the routing information PATH.  Each byte of\r
                             the Device Path associated with DriverHandle is converted\r
@@ -1689,17 +1683,17 @@ ConstructConfigHdr (
     Guid      = (EFI_GUID *)(UINTN *)&((EFI_IFR_VARSTORE *) OpCodeData)->Guid;\r
     AsciiName = (CHAR8 *) ((EFI_IFR_VARSTORE *) OpCodeData)->Name;\r
     break;\r
-  \r
+\r
   case EFI_IFR_VARSTORE_NAME_VALUE_OP:\r
     Guid      = (EFI_GUID *)(UINTN *)&((EFI_IFR_VARSTORE_NAME_VALUE *) OpCodeData)->Guid;\r
     AsciiName = NULL;\r
     break;\r
-  \r
+\r
   case EFI_IFR_VARSTORE_EFI_OP:\r
     Guid      = (EFI_GUID *)(UINTN *)&((EFI_IFR_VARSTORE_EFI *) OpCodeData)->Guid;\r
     AsciiName = (CHAR8 *) ((EFI_IFR_VARSTORE_EFI *) OpCodeData)->Name;\r
     break;\r
-  \r
+\r
   default:\r
     ASSERT (FALSE);\r
     Guid      = NULL;\r
@@ -1717,7 +1711,7 @@ ConstructConfigHdr (
   }\r
 \r
   //\r
-  // Compute the length of Name in Unicode characters.  \r
+  // Compute the length of Name in Unicode characters.\r
   // If Name is NULL, then the length is 0.\r
   //\r
   NameLength = 0;\r
@@ -1773,7 +1767,7 @@ ConstructConfigHdr (
       String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) / sizeof (CHAR16));\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Append L"&NAME="\r
   //\r
@@ -1841,12 +1835,12 @@ EFI_STRING
 ConstructRequestElement (\r
   IN CHAR16      *Name,\r
   IN UINT16      Offset,\r
-  IN UINT16      Width  \r
+  IN UINT16      Width\r
   )\r
 {\r
   CHAR16    *StringPtr;\r
   UINTN     Length;\r
-  \r
+\r
   if (Name != NULL) {\r
     //\r
     // Add <BlockName> length for each Name\r
@@ -1886,10 +1880,10 @@ ConstructRequestElement (
     // Append OFFSET=XXXX&WIDTH=YYYY\0\r
     //\r
     UnicodeSPrint (\r
-      StringPtr, \r
-      (7 + 4 + 7 + 4 + 1) * sizeof (CHAR16), \r
-      L"OFFSET=%04X&WIDTH=%04X", \r
-      Offset, \r
+      StringPtr,\r
+      (7 + 4 + 7 + 4 + 1) * sizeof (CHAR16),\r
+      L"OFFSET=%04X&WIDTH=%04X",\r
+      Offset,\r
       Width\r
     );\r
   }\r
@@ -1922,7 +1916,7 @@ GetNameFromId (
 \r
   Name = NULL;\r
   BestLanguage = NULL;\r
-  PlatformLanguage = NULL; \r
+  PlatformLanguage = NULL;\r
   SupportedLanguages = NULL;\r
 \r
   GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&PlatformLanguage, NULL);\r
@@ -1932,10 +1926,10 @@ GetNameFromId (
   // Get the best matching language from SupportedLanguages\r
   //\r
   BestLanguage = GetBestLanguage (\r
-                   SupportedLanguages, \r
+                   SupportedLanguages,\r
                    FALSE,                                             // RFC 4646 mode\r
                    PlatformLanguage != NULL ? PlatformLanguage : "",  // Highest priority\r
-                   SupportedLanguages,                                // Lowest priority \r
+                   SupportedLanguages,                                // Lowest priority\r
                    NULL\r
                    );\r
   if (BestLanguage == NULL) {\r
@@ -2013,7 +2007,7 @@ ExtractConfigRequest (
   IN  EFI_STRING_ID         KeywordStrId,\r
   OUT UINT8                 **OpCodeData,\r
   OUT EFI_STRING            *ConfigRequest\r
-  ) \r
+  )\r
 {\r
   LIST_ENTRY                          *Link;\r
   HII_DATABASE_PACKAGE_LIST_INSTANCE  *PackageListNode;\r
@@ -2053,7 +2047,7 @@ ExtractConfigRequest (
       //\r
       ASSERT (Header->VarStoreId != 0);\r
       DEBUG ((EFI_D_INFO, "Varstore Id: 0x%x\n", Header->VarStoreId));\r
-      \r
+\r
       Storage = FindStorageFromVarId (FormPackage, Header->VarStoreId);\r
       ASSERT (Storage != NULL);\r
 \r
@@ -2116,7 +2110,7 @@ ExtractConfigResp (
   IN  EFI_STRING            ValueElement,\r
   OUT UINT8                 **OpCodeData,\r
   OUT EFI_STRING            *ConfigResp\r
-  ) \r
+  )\r
 {\r
   LIST_ENTRY                          *Link;\r
   HII_DATABASE_PACKAGE_LIST_INSTANCE  *PackageListNode;\r
@@ -2156,7 +2150,7 @@ ExtractConfigResp (
       //\r
       ASSERT (Header->VarStoreId != 0);\r
       DEBUG ((EFI_D_INFO, "Varstore Id: 0x%x\n", Header->VarStoreId));\r
-      \r
+\r
       Storage = FindStorageFromVarId (FormPackage, Header->VarStoreId);\r
       ASSERT (Storage != NULL);\r
 \r
@@ -2341,7 +2335,7 @@ GetStringIdFromDatabase (
       *ProgressErr = GetStringIdFromRecord (Record, NameSpace, KeywordData, KeywordStringId);\r
       if (*ProgressErr == KEYWORD_HANDLER_NO_ERROR) {\r
         *DataBaseRecord = Record;\r
-        \r
+\r
         if ((DevicePathPkg = Record->PackageList->DevicePathPkg) != NULL) {\r
           DestDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) (DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER));\r
           DevicePathSize = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) DestDevicePath);\r
@@ -2361,7 +2355,7 @@ GetStringIdFromDatabase (
         return EFI_OUT_OF_RESOURCES;\r
       } else if (*ProgressErr == KEYWORD_HANDLER_KEYWORD_NOT_FOUND) {\r
         FindNameSpace = TRUE;\r
-      }  \r
+      }\r
     }\r
 \r
     //\r
@@ -2394,7 +2388,7 @@ GetStringIdFromDatabase (
 **/\r
 EFI_STATUS\r
 GenerateKeywordResp (\r
-  IN  CHAR8                          *NameSpace, \r
+  IN  CHAR8                          *NameSpace,\r
   IN  EFI_DEVICE_PATH_PROTOCOL       *DevicePath,\r
   IN  EFI_STRING                     KeywordData,\r
   IN  EFI_STRING                     ValueStr,\r
@@ -2510,7 +2504,7 @@ GenerateKeywordResp (
   if (PathHdr != NULL) {\r
     FreePool (PathHdr);\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -2562,9 +2556,9 @@ MergeToMultiKeywordResp (
 }\r
 \r
 /**\r
-  Enumerate all keyword in the system. \r
-  \r
-  If error occur when parse one keyword, just skip it and parse the next one. \r
+  Enumerate all keyword in the system.\r
+\r
+  If error occur when parse one keyword, just skip it and parse the next one.\r
 \r
   This is a internal function.\r
 \r
@@ -2649,7 +2643,7 @@ EnumerateAllKeywords (
         // Any valid string start from 2. so here initial it to 1.\r
         //\r
         NextStringId = 1;\r
-        \r
+\r
         //\r
         // Enumerate all valid stringid in the package.\r
         //\r
@@ -2664,7 +2658,7 @@ EnumerateAllKeywords (
             //\r
             goto Error;\r
           }\r
-          \r
+\r
           //\r
           // 3.4 Extract Value for the input keyword.\r
           //\r
@@ -2698,7 +2692,7 @@ EnumerateAllKeywords (
             //\r
             goto Done;\r
           }\r
-          \r
+\r
           //\r
           // 6. Merge to the MultiKeywordResp string.\r
           //\r
@@ -2721,7 +2715,7 @@ Error:
           if (KeywordResp != NULL) {\r
             FreePool (KeywordResp);\r
             KeywordResp = NULL;\r
-          } \r
+          }\r
         }\r
 \r
         if (LocalNameSpace != NULL) {\r
@@ -2729,7 +2723,7 @@ Error:
           LocalNameSpace = NULL;\r
         }\r
       }\r
-    } \r
+    }\r
   }\r
 \r
   //\r
@@ -2746,7 +2740,7 @@ Error:
     Status = EFI_SUCCESS;\r
   }\r
   *MultiResp = MultiKeywordResp;\r
-  \r
+\r
 Done:\r
   if (LocalNameSpace != NULL) {\r
     FreePool (LocalNameSpace);\r
@@ -2766,18 +2760,18 @@ Done:
   This function accepts a <MultiKeywordResp> formatted string, finds the associated\r
   keyword owners, creates a <MultiConfigResp> string from it and forwards it to the\r
   EFI_HII_ROUTING_PROTOCOL.RouteConfig function.\r
-  \r
-  If there is an issue in resolving the contents of the KeywordString, then the \r
-  function returns an error and also sets the Progress and ProgressErr with the \r
+\r
+  If there is an issue in resolving the contents of the KeywordString, then the\r
+  function returns an error and also sets the Progress and ProgressErr with the\r
   appropriate information about where the issue occurred and additional data about\r
-  the nature of the issue. \r
-  \r
+  the nature of the issue.\r
+\r
   In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND\r
   error is generated during processing the second or later keyword element, the system\r
-  storage associated with earlier keywords is not modified. All elements of the \r
+  storage associated with earlier keywords is not modified. All elements of the\r
   KeywordString must successfully pass all tests for format and access prior to making\r
   any modifications to storage.\r
-  \r
+\r
   In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString\r
   containing multiple keywords, the state of storage associated with earlier keywords\r
   is undefined.\r
@@ -2785,18 +2779,18 @@ Done:
 \r
   @param This             Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
 \r
-  @param KeywordString    A null-terminated string in <MultiKeywordResp> format. \r
+  @param KeywordString    A null-terminated string in <MultiKeywordResp> format.\r
 \r
-  @param Progress         On return, points to a character in the KeywordString. \r
-                          Points to the string's NULL terminator if the request \r
-                          was successful. Points to the most recent '&' before \r
+  @param Progress         On return, points to a character in the KeywordString.\r
+                          Points to the string's NULL terminator if the request\r
+                          was successful. Points to the most recent '&' before\r
                           the first failing name / value pair (or the beginning\r
                           of the string if the failure is in the first name / value\r
                           pair) if the request was not successful.\r
 \r
   @param ProgressErr      If during the processing of the KeywordString there was\r
-                          a failure, this parameter gives additional information \r
-                          about the possible source of the problem. The various \r
+                          a failure, this parameter gives additional information\r
+                          about the possible source of the problem. The various\r
                           errors are defined in "Related Definitions" below.\r
 \r
 \r
@@ -2804,16 +2798,16 @@ Done:
 \r
   @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
                                   1. KeywordString is NULL.\r
-                                  2. Parsing of the KeywordString resulted in an \r
+                                  2. Parsing of the KeywordString resulted in an\r
                                      error. See Progress and ProgressErr for more data.\r
 \r
-  @retval EFI_NOT_FOUND           An element of the KeywordString was not found. \r
+  @retval EFI_NOT_FOUND           An element of the KeywordString was not found.\r
                                   See ProgressErr for more data.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.  \r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.\r
                                   See ProgressErr for more data.\r
-                                  \r
-  @retval EFI_ACCESS_DENIED       The action violated system policy. See ProgressErr \r
+\r
+  @retval EFI_ACCESS_DENIED       The action violated system policy. See ProgressErr\r
                                   for more data.\r
 \r
   @retval EFI_DEVICE_ERROR        An unexpected system error occurred. See ProgressErr\r
@@ -2821,7 +2815,7 @@ Done:
 \r
 **/\r
 EFI_STATUS\r
-EFIAPI \r
+EFIAPI\r
 EfiConfigKeywordHandlerSetData (\r
   IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,\r
   IN CONST EFI_STRING                    KeywordString,\r
@@ -2974,7 +2968,7 @@ EfiConfigKeywordHandlerSetData (
       Status = EFI_ACCESS_DENIED;\r
       goto Done;\r
     }\r
-    \r
+\r
     //\r
     // 9. Merge to the MultiKeywordResp string.\r
     //\r
@@ -2991,7 +2985,7 @@ EfiConfigKeywordHandlerSetData (
     FreePool (KeywordData);\r
     FreePool (ValueElement);\r
     NameSpace = NULL;\r
-    DevicePath = NULL; \r
+    DevicePath = NULL;\r
     KeywordData = NULL;\r
     ValueElement = NULL;\r
     if (ConfigResp != NULL) {\r
@@ -3013,7 +3007,7 @@ EfiConfigKeywordHandlerSetData (
     Status = EFI_DEVICE_ERROR;\r
     goto Done;\r
   }\r
-  \r
+\r
   *ProgressErr = KEYWORD_HANDLER_NO_ERROR;\r
 \r
 Done:\r
@@ -3049,56 +3043,56 @@ Done:
 \r
 /**\r
 \r
-  This function accepts a <MultiKeywordRequest> formatted string, finds the underlying \r
+  This function accepts a <MultiKeywordRequest> formatted string, finds the underlying\r
   keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the\r
   EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.\r
-  \r
+\r
   If there is an issue in resolving the contents of the KeywordString, then the function\r
   returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the\r
   appropriate information about where the issue occurred and additional data about the\r
   nature of the issue.\r
-  \r
+\r
   In the case when KeywordString is NULL, or contains multiple keywords, or when\r
   EFI_NOT_FOUND is generated while processing the keyword elements, the Results string\r
-  contains values returned for all keywords processed prior to the keyword generating the \r
+  contains values returned for all keywords processed prior to the keyword generating the\r
   error but no values for the keyword with error or any following keywords.\r
 \r
-  \r
+\r
   @param This           Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
-  \r
+\r
   @param NameSpaceId    A null-terminated string containing the platform configuration\r
                         language to search through in the system. If a NULL is passed\r
                         in, then it is assumed that any platform configuration language\r
                         with the prefix of "x-UEFI-" are searched.\r
-                        \r
+\r
   @param KeywordString  A null-terminated string in <MultiKeywordRequest> format. If a\r
-                        NULL is passed in the KeywordString field, all of the known \r
-                        keywords in the system for the NameSpaceId specified are \r
+                        NULL is passed in the KeywordString field, all of the known\r
+                        keywords in the system for the NameSpaceId specified are\r
                         returned in the Results field.\r
-  \r
+\r
   @param Progress       On return, points to a character in the KeywordString. Points\r
-                        to the string's NULL terminator if the request was successful. \r
+                        to the string's NULL terminator if the request was successful.\r
                         Points to the most recent '&' before the first failing name / value\r
                         pair (or the beginning of the string if the failure is in the first\r
                         name / value pair) if the request was not successful.\r
-                        \r
+\r
   @param ProgressErr    If during the processing of the KeywordString there was a\r
-                        failure, this parameter gives additional information about the \r
+                        failure, this parameter gives additional information about the\r
                         possible source of the problem. See the definitions in SetData()\r
                         for valid value definitions.\r
-  \r
+\r
   @param Results        A null-terminated string in <MultiKeywordResp> format is returned\r
-                        which has all the values filled in for the keywords in the \r
+                        which has all the values filled in for the keywords in the\r
                         KeywordString. This is a callee-allocated field, and must be freed\r
-                        by the caller after being used. \r
+                        by the caller after being used.\r
 \r
   @retval EFI_SUCCESS             The specified action was completed successfully.\r
-  \r
+\r
   @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
                                   1.Progress, ProgressErr, or Results is NULL.\r
                                   2.Parsing of the KeywordString resulted in an error. See\r
                                     Progress and ProgressErr for more data.\r
-  \r
+\r
 \r
   @retval EFI_NOT_FOUND           An element of the KeywordString was not found. See\r
                                   ProgressErr for more data.\r
@@ -3108,7 +3102,7 @@ Done:
 \r
   @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.  See\r
                                   ProgressErr for more data.\r
-                                  \r
+\r
   @retval EFI_ACCESS_DENIED       The action violated system policy.  See ProgressErr for\r
                                   more data.\r
 \r
@@ -3117,12 +3111,12 @@ Done:
 \r
 **/\r
 EFI_STATUS\r
-EFIAPI \r
+EFIAPI\r
 EfiConfigKeywordHandlerGetData (\r
   IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL  *This,\r
   IN CONST EFI_STRING                     NameSpaceId, OPTIONAL\r
   IN CONST EFI_STRING                     KeywordString, OPTIONAL\r
-  OUT EFI_STRING                          *Progress, \r
+  OUT EFI_STRING                          *Progress,\r
   OUT UINT32                              *ProgressErr,\r
   OUT EFI_STRING                          *Results\r
   )\r
@@ -3132,7 +3126,7 @@ EfiConfigKeywordHandlerGetData (
   EFI_DEVICE_PATH_PROTOCOL            *DevicePath;\r
   HII_DATABASE_RECORD                 *DataBaseRecord;\r
   CHAR16                              *StringPtr;\r
-  CHAR16                              *NextStringPtr;  \r
+  CHAR16                              *NextStringPtr;\r
   CHAR16                              *KeywordData;\r
   EFI_STRING_ID                       KeywordStringId;\r
   UINT8                               *OpCode;\r
@@ -3188,7 +3182,7 @@ EfiConfigKeywordHandlerGetData (
       return EFI_INVALID_PARAMETER;\r
     }\r
   }\r
-  \r
+\r
   if (KeywordString != NULL) {\r
     //\r
     // Use temp string to avoid changing input string buffer.\r
@@ -3208,7 +3202,7 @@ EfiConfigKeywordHandlerGetData (
       }\r
       StringPtr = NextStringPtr;\r
 \r
-     \r
+\r
       //\r
       // 3. Process Keyword section from the input keywordRequest string.\r
       //\r
@@ -3240,7 +3234,7 @@ EfiConfigKeywordHandlerGetData (
       if (EFI_ERROR (Status)) {\r
         goto Done;\r
       }\r
-      \r
+\r
       //\r
       // 3.4 Extract Value for the input keyword.\r
       //\r
@@ -3293,7 +3287,7 @@ EfiConfigKeywordHandlerGetData (
       FreePool (KeywordData);\r
       FreePool (ValueElement);\r
       FreePool (ConfigRequest);\r
-      DevicePath = NULL; \r
+      DevicePath = NULL;\r
       KeywordData = NULL;\r
       ValueElement = NULL;\r
       ConfigRequest = NULL;\r