]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.c
index c2cfa5c5c829c582f0bbc804d30e8f0f838f89ed..922219a58e4ed9917f0eb1b433e4f0d924a64dda 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Entry and initialization module for the browser.\r
 \r
-Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -152,7 +152,7 @@ GetFirstFormId (
 **/\r
 FORM_ENTRY_INFO *\r
 UiFindMenuList (\r
-  IN EFI_HII_HANDLE       HiiHandle, \r
+  IN EFI_HII_HANDLE       HiiHandle,\r
   IN EFI_GUID             *FormSetGuid,\r
   IN UINT16               FormId\r
   )\r
@@ -168,7 +168,7 @@ UiFindMenuList (
   while (!IsNull (&mPrivateData.FormBrowserEx2.FormViewHistoryHead, Link)) {\r
     MenuList = FORM_ENTRY_INFO_FROM_LINK (Link);\r
     Link = GetNextNode (&mPrivateData.FormBrowserEx2.FormViewHistoryHead, Link);\r
-    \r
+\r
     //\r
     // If already find the menu, free the menus behind it.\r
     //\r
@@ -208,7 +208,7 @@ UiFindMenuList (
 \r
   @param  CurrentMenu    Current Menu\r
   @param  SettingLevel   Whether find parent menu in Form Level or Formset level.\r
-                         In form level, just find the parent menu; \r
+                         In form level, just find the parent menu;\r
                          In formset level, find the parent menu which has different\r
                          formset guid value.\r
 \r
@@ -228,7 +228,7 @@ UiFindParentMenu (
   if (CurrentMenu == NULL) {\r
     return NULL;\r
   }\r
-  \r
+\r
   ParentMenu = NULL;\r
   Link       = &CurrentMenu->Link;\r
 \r
@@ -285,7 +285,7 @@ UiFreeMenuList (
 \r
 /**\r
   Copy current Menu list to the new menu list.\r
-  \r
+\r
   @param  NewMenuListHead        New create Menu list.\r
   @param  CurrentMenuListHead    Current Menu list.\r
 \r
@@ -622,7 +622,7 @@ SendForm (
                                  distribution.\r
 \r
 **/\r
-EFI_STATUS \r
+EFI_STATUS\r
 ProcessStorage (\r
   IN OUT UINTN                         *ResultsDataSize,\r
   IN OUT EFI_STRING                    *ResultsData,\r
@@ -696,8 +696,8 @@ ProcessStorage (
 }\r
 \r
 /**\r
-  This routine called this service in the browser to retrieve or set certain uncommitted \r
-  state information that resides in the open formsets. \r
+  This routine called this service in the browser to retrieve or set certain uncommitted\r
+  state information that resides in the open formsets.\r
 \r
   @param  This                   A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
                                  instance.\r
@@ -801,7 +801,7 @@ BrowserCallback (
       //\r
       // Different formsets may have same varstore, so here just set the flag\r
       // not exit the circle.\r
-      // \r
+      //\r
       Found = TRUE;\r
       break;\r
     }\r
@@ -826,7 +826,7 @@ BrowserCallback (
     }\r
 \r
     FormsetStorage = FORMSET_STORAGE_FROM_LINK (Link);\r
-    \r
+\r
     Status = ProcessStorage (&TotalSize, &ResultsData, RetrieveData, FormsetStorage->BrowserStorage);\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r
@@ -837,7 +837,7 @@ BrowserCallback (
     Status = TotalSize <= *ResultsDataSize ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;\r
     *ResultsDataSize = TotalSize;\r
   }\r
-   \r
+\r
   return Status;\r
 \r
 }\r
@@ -936,7 +936,7 @@ InitializeSetup (
                   &mPrivateData.FormBrowserEx2\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
-  \r
+\r
   Status = gBS->InstallProtocolInterface (\r
                   &mPrivateData.Handle,\r
                   &gEdkiiFormBrowserExProtocolGuid,\r
@@ -962,7 +962,7 @@ InitializeSetup (
       &Registration\r
       );\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -1465,7 +1465,7 @@ BufferToValue (
   Buffer = NULL;\r
 \r
   IsString = (BOOLEAN) ((Question->HiiValue.Type == EFI_IFR_TYPE_STRING) ?  TRUE : FALSE);\r
-  if (Question->Storage->Type == EFI_HII_VARSTORE_BUFFER || \r
+  if (Question->Storage->Type == EFI_HII_VARSTORE_BUFFER ||\r
       Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {\r
     IsBufferStorage = TRUE;\r
   } else {\r
@@ -1620,17 +1620,17 @@ GetQuestionValue (
         FreePool (Question->ValueExpression->Result.Buffer);\r
       }\r
       Question->HiiValue.Type = Question->ValueExpression->Result.Type;\r
-      CopyMem (&Question->HiiValue.Value, &Question->ValueExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE));      \r
+      CopyMem (&Question->HiiValue.Value, &Question->ValueExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE));\r
     }\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Get question value by read expression.\r
   //\r
   if (Question->ReadExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) {\r
     Status = EvaluateExpression (FormSet, Form, Question->ReadExpression);\r
-    if (!EFI_ERROR (Status) && \r
+    if (!EFI_ERROR (Status) &&\r
       ((Question->ReadExpression->Result.Type < EFI_IFR_TYPE_OTHER) || (Question->ReadExpression->Result.Type == EFI_IFR_TYPE_BUFFER))) {\r
       //\r
       // Only update question value to the valid result.\r
@@ -1647,7 +1647,7 @@ GetQuestionValue (
         FreePool (Question->ReadExpression->Result.Buffer);\r
       }\r
       Question->HiiValue.Type = Question->ReadExpression->Result.Type;\r
-      CopyMem (&Question->HiiValue.Value, &Question->ReadExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE));       \r
+      CopyMem (&Question->HiiValue.Value, &Question->ReadExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE));\r
       return EFI_SUCCESS;\r
     }\r
   }\r
@@ -1748,7 +1748,7 @@ GetQuestionValue (
     Dst = (UINT8 *) &Question->HiiValue.Value;\r
   }\r
 \r
-  if (Storage->Type == EFI_HII_VARSTORE_BUFFER || \r
+  if (Storage->Type == EFI_HII_VARSTORE_BUFFER ||\r
       Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {\r
     IsBufferStorage = TRUE;\r
   } else {\r
@@ -1933,7 +1933,7 @@ SetQuestionValue (
   if (Question->ValueExpression != NULL) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Before set question value, evaluate its write expression.\r
   //\r
@@ -2028,7 +2028,7 @@ SetQuestionValue (
     Src = (UINT8 *) &Question->HiiValue.Value;\r
   }\r
 \r
-  if (Storage->Type == EFI_HII_VARSTORE_BUFFER || \r
+  if (Storage->Type == EFI_HII_VARSTORE_BUFFER ||\r
       Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {\r
     IsBufferStorage = TRUE;\r
   } else {\r
@@ -2199,7 +2199,7 @@ SetQuestionValue (
       return Status;\r
     }\r
     FreePool (ConfigResp);\r
-    \r
+\r
     //\r
     // Sync storage, from editbuffer to buffer.\r
     //\r
@@ -2322,9 +2322,9 @@ ValidateQuestion (
 }\r
 \r
 /**\r
-  Perform question check. \r
-  \r
-  If one question has more than one check, process form high priority to low. \r
+  Perform question check.\r
+\r
+  If one question has more than one check, process form high priority to low.\r
   Only one error info will be popup.\r
 \r
   @param  FormSet                FormSet data structure.\r
@@ -2425,7 +2425,7 @@ NoSubmitCheck (
 \r
   @param  Storage                The storage which need to sync.\r
   @param  ConfigRequest          The config request string which used to sync storage.\r
-  @param  SyncOrRestore          Sync the buffer to editbuffer or Restore  the \r
+  @param  SyncOrRestore          Sync the buffer to editbuffer or Restore  the\r
                                  editbuffer to buffer\r
                                  if TRUE, copy the editbuffer to the buffer.\r
                                  if FALSE, copy the buffer to the editbuffer.\r
@@ -2452,7 +2452,7 @@ SynchronizeStorage (
   Status = EFI_SUCCESS;\r
   Result = NULL;\r
 \r
-  if (Storage->Type == EFI_HII_VARSTORE_BUFFER || \r
+  if (Storage->Type == EFI_HII_VARSTORE_BUFFER ||\r
       (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER)) {\r
     BufferSize = Storage->Size;\r
 \r
@@ -2787,7 +2787,7 @@ UpdateFlagForForm (
       if ((Question->QuestionFlags & EFI_IFR_FLAG_RECONNECT_REQUIRED) != 0) {\r
         gFlagReconnect = TRUE;\r
       }\r
-    } \r
+    }\r
   }\r
 }\r
 \r
@@ -2796,7 +2796,7 @@ UpdateFlagForForm (
   Also clean ValueChanged flag for all statements.\r
 \r
   Form level or formset level, only one.\r
-  \r
+\r
   @param  SetFlag                Whether need to set the Reset Flag.\r
   @param  FormSet                FormSet data structure.\r
   @param  Form                   Form data structure.\r
@@ -2806,7 +2806,7 @@ VOID
 ValueChangeResetFlagUpdate (\r
   IN BOOLEAN                          SetFlag,\r
   IN FORM_BROWSER_FORMSET             *FormSet,\r
-  IN FORM_BROWSER_FORM                *Form  \r
+  IN FORM_BROWSER_FORM                *Form\r
   )\r
 {\r
   FORM_BROWSER_FORM       *CurrentForm;\r
@@ -2827,8 +2827,8 @@ ValueChangeResetFlagUpdate (
 }\r
 \r
 /**\r
-  Base on the return Progress string to find the form. \r
-  \r
+  Base on the return Progress string to find the form.\r
+\r
   Base on the first return Offset/Width (Name) string to find the form\r
   which keep this string.\r
 \r
@@ -3109,9 +3109,9 @@ ConfirmSaveFail (
   ASSERT (StringBuffer != NULL);\r
 \r
   UnicodeSPrint (\r
-    StringBuffer, \r
-    24 * sizeof (CHAR16) + StrSize (FormTitle), \r
-    L"Submit Fail For Form: %s.", \r
+    StringBuffer,\r
+    24 * sizeof (CHAR16) + StrSize (FormTitle),\r
+    L"Submit Fail For Form: %s.",\r
     FormTitle\r
     );\r
 \r
@@ -3148,9 +3148,9 @@ ConfirmNoSubmitFail (
   ASSERT (StringBuffer != NULL);\r
 \r
   UnicodeSPrint (\r
-    StringBuffer, \r
-    24 * sizeof (CHAR16) + StrSize (FormTitle), \r
-    L"NO_SUBMIT_IF error For Form: %s.", \r
+    StringBuffer,\r
+    24 * sizeof (CHAR16) + StrSize (FormTitle),\r
+    L"NO_SUBMIT_IF error For Form: %s.",\r
     FormTitle\r
     );\r
 \r
@@ -3251,7 +3251,7 @@ DiscardForm (
     while (!IsNull (&FormSet->FormListHead, Link)) {\r
       Form = FORM_BROWSER_FORM_FROM_LINK (Link);\r
       Link = GetNextNode (&FormSet->FormListHead, Link);\r
-      \r
+\r
       //\r
       // Call callback with Changed type to inform the driver.\r
       //\r
@@ -3292,7 +3292,7 @@ DiscardForm (
     mSystemLevelFormSet = OldFormSet;\r
   }\r
 \r
-  return EFI_SUCCESS;  \r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -3441,9 +3441,9 @@ SubmitForForm (
 \r
   @param  FormSet                FormSet data structure.\r
   @param  SkipProcessFail        Whether skip to process the save failed storage.\r
-                                 If submit formset is called when do system level save, \r
-                                 set this value to true and process the failed formset \r
-                                 together. \r
+                                 If submit formset is called when do system level save,\r
+                                 set this value to true and process the failed formset\r
+                                 together.\r
                                  if submit formset is called when do formset level save,\r
                                  set the value to false and process the failed storage\r
                                  right after process all storages for this formset.\r
@@ -3478,7 +3478,7 @@ SubmitForFormSet (
     return EFI_SUCCESS;\r
   }\r
 \r
-  Form = NULL; \r
+  Form = NULL;\r
   Status = NoSubmitCheck (FormSet, &Form, &Question);\r
   if (EFI_ERROR (Status)) {\r
     if (SkipProcessFail) {\r
@@ -3639,7 +3639,7 @@ SubmitForFormSet (
 \r
   //\r
   // 5. Update the NV flag.\r
-  // \r
+  //\r
   ValueChangeResetFlagUpdate(TRUE, FormSet, NULL);\r
 \r
   //\r
@@ -3690,7 +3690,7 @@ SubmitForSystem (
 \r
     //\r
     // Remove maintain backup list after save except for the current using FormSet.\r
-    //  \r
+    //\r
     if (!IsHiiHandleInBrowserContext (LocalFormSet->HiiHandle)) {\r
       CleanBrowserStorage(LocalFormSet);\r
       RemoveEntryList (&LocalFormSet->Link);\r
@@ -3937,7 +3937,7 @@ GetOffsetFromConfigResp (
     RequestElement += StrLen (Question->BlockName) + StrLen (L"&VALUE=");\r
     return RequestElement;\r
   }\r
-  \r
+\r
   //\r
   // 2. Change all hex digits in Question->BlockName to lower and compare again.\r
   //\r
@@ -3973,7 +3973,7 @@ GetDefaultValueFromAltCfg (
   IN     FORM_BROWSER_FORM                *Form,\r
   IN OUT FORM_BROWSER_STATEMENT           *Question\r
   )\r
-{ \r
+{\r
   BROWSER_STORAGE              *Storage;\r
   FORMSET_STORAGE              *FormSetStorage;\r
   CHAR16                       *ConfigResp;\r
@@ -4039,7 +4039,7 @@ INTN
 GetDefaultIdForCallBack (\r
   UINTN DefaultId\r
   )\r
-{ \r
+{\r
   if (DefaultId == EFI_HII_DEFAULT_CLASS_STANDARD) {\r
     return EFI_BROWSER_ACTION_DEFAULT_STANDARD;\r
   } else if (DefaultId == EFI_HII_DEFAULT_CLASS_MANUFACTURING) {\r
@@ -4240,7 +4240,7 @@ GetQuestionDefault (
   // There are Five ways to specify default value for a Question:\r
   //  1, use call back function (highest priority)\r
   //  2, use ExtractConfig function\r
-  //  3, use nested EFI_IFR_DEFAULT \r
+  //  3, use nested EFI_IFR_DEFAULT\r
   //  4, set flags of EFI_ONE_OF_OPTION (provide Standard and Manufacturing default)\r
   //  5, set flags of EFI_IFR_CHECKBOX (provide Standard and Manufacturing default) (lowest priority)\r
   //\r
@@ -4291,7 +4291,7 @@ ReGetDefault:
   //\r
   // Get default value from altcfg string.\r
   //\r
-  if (ConfigAccess != NULL) {  \r
+  if (ConfigAccess != NULL) {\r
     Status = GetDefaultValueFromAltCfg(FormSet, Form, Question);\r
     if (!EFI_ERROR (Status)) {\r
         return Status;\r
@@ -4328,7 +4328,7 @@ ReGetDefault:
             FreePool (Default->ValueExpression->Result.Buffer);\r
           }\r
           HiiValue->Type = Default->ValueExpression->Result.Type;\r
-          CopyMem (&HiiValue->Value, &Default->ValueExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE));       \r
+          CopyMem (&HiiValue->Value, &Default->ValueExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE));\r
         } else {\r
           //\r
           // Default value is embedded in EFI_IFR_DEFAULT\r
@@ -4467,7 +4467,7 @@ ReGetDefault:
         }\r
         break;\r
       default:\r
-        break;     \r
+        break;\r
       }\r
     } else {\r
       if ((HiiValue->Value.u64 < Question->Minimum) || (HiiValue->Value.u64 > Question->Maximum)) {\r
@@ -4776,7 +4776,7 @@ CleanAltCfgForFormSet (
 /**\r
   Reset Questions to their initial value or default value in a Form, Formset or System.\r
 \r
-  GetDefaultValueScope parameter decides which questions will reset \r
+  GetDefaultValueScope parameter decides which questions will reset\r
   to its default value.\r
 \r
   @param  FormSet                FormSet data structure.\r
@@ -5067,7 +5067,7 @@ IsQuestionValueChanged (
 /**\r
   Initialize Question's Edit copy from Storage.\r
 \r
-  @param  Selection              Selection contains the information about \r
+  @param  Selection              Selection contains the information about\r
                                  the Selection, form and formset to be displayed.\r
                                  Selection action may be updated in retrieve callback.\r
                                  If Selection is NULL, only initialize Question value.\r
@@ -5087,7 +5087,7 @@ LoadFormConfig (
   EFI_STATUS                  Status;\r
   LIST_ENTRY                  *Link;\r
   FORM_BROWSER_STATEMENT      *Question;\r
-  \r
+\r
   Link = GetFirstNode (&Form->StatementListHead);\r
   while (!IsNull (&Form->StatementListHead, Link)) {\r
     Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
@@ -5117,7 +5117,7 @@ LoadFormConfig (
 /**\r
   Initialize Question's Edit copy from Storage for the whole Formset.\r
 \r
-  @param  Selection              Selection contains the information about \r
+  @param  Selection              Selection contains the information about\r
                                  the Selection, form and formset to be displayed.\r
                                  Selection action may be updated in retrieve callback.\r
                                  If Selection is NULL, only initialize Question value.\r
@@ -5153,7 +5153,7 @@ LoadFormSetConfig (
 \r
   //\r
   // Finished question initialization.\r
-  // \r
+  //\r
   FormSet->QuestionInited = TRUE;\r
 \r
   return EFI_SUCCESS;\r
@@ -5189,8 +5189,8 @@ RemoveElement (
   DestStr = NewStr;\r
   NewStr += StrLen (RequestElement);\r
   CopyMem (DestStr, NewStr, StrSize (NewStr));\r
-  \r
-  Storage->SpareStrLen += StrLen (RequestElement);  \r
+\r
+  Storage->SpareStrLen += StrLen (RequestElement);\r
 }\r
 \r
 /**\r
@@ -5235,7 +5235,7 @@ RemoveConfigRequest (
   if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_NAME_VALUE) {\r
     RequestElement = StrStr (ConfigRequest, L"PATH");\r
     ASSERT (RequestElement != NULL);\r
-    RequestElement = StrStr (RequestElement, SearchKey);    \r
+    RequestElement = StrStr (RequestElement, SearchKey);\r
   } else {\r
     RequestElement = StrStr (ConfigRequest, SearchKey);\r
   }\r
@@ -5305,7 +5305,7 @@ CleanBrowserStorage (
       RemoveConfigRequest (Storage, Storage->ConfigRequest);\r
     } else if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_BUFFER ||\r
                Storage->BrowserStorage->Type == EFI_HII_VARSTORE_NAME_VALUE) {\r
-      if (Storage->BrowserStorage->ConfigRequest != NULL) { \r
+      if (Storage->BrowserStorage->ConfigRequest != NULL) {\r
         FreePool (Storage->BrowserStorage->ConfigRequest);\r
         Storage->BrowserStorage->ConfigRequest = NULL;\r
       }\r
@@ -5324,7 +5324,7 @@ CleanBrowserStorage (
   @retval FALSE       The Element not in the configReqeust String.\r
 \r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
 ElementValidation (\r
   BROWSER_STORAGE   *BrowserStorage,\r
   CHAR16            *RequestElement\r
@@ -5391,7 +5391,7 @@ AppendConfigRequest (
   @retval FALSE                  All elements covered by current used elements.\r
 \r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
 ConfigRequestAdjust (\r
   IN  BROWSER_STORAGE         *Storage,\r
   IN  CHAR16                  *Request,\r
@@ -5440,7 +5440,7 @@ ConfigRequestAdjust (
   if (Storage->Type == EFI_HII_VARSTORE_NAME_VALUE) {\r
     RequestElement = StrStr (ConfigRequest, L"PATH");\r
     ASSERT (RequestElement != NULL);\r
-    RequestElement = StrStr (RequestElement, SearchKey);    \r
+    RequestElement = StrStr (RequestElement, SearchKey);\r
   } else {\r
     RequestElement = StrStr (ConfigRequest, SearchKey);\r
   }\r
@@ -5476,7 +5476,7 @@ ConfigRequestAdjust (
         *NextRequestElement = L'\0';\r
       }\r
     }\r
\r
+\r
     if (!ElementValidation (Storage, RequestElement)) {\r
       //\r
       // Add this element to the Storage->BrowserStorage->AllRequestElement.\r
@@ -5545,7 +5545,7 @@ LoadStorage (
       }\r
 \r
       //\r
-      // Just update the ConfigRequest, if storage already initialized. \r
+      // Just update the ConfigRequest, if storage already initialized.\r
       //\r
       if (Storage->BrowserStorage->Initialized) {\r
         ConfigRequestAdjust(Storage->BrowserStorage, Storage->ConfigRequest, FALSE);\r
@@ -5569,9 +5569,9 @@ LoadStorage (
     ConfigRequest = AllocateZeroPool (StrLen);\r
     ASSERT (ConfigRequest != NULL);\r
     UnicodeSPrint (\r
-               ConfigRequest, \r
-               StrLen, \r
-               L"%s&OFFSET=0&WIDTH=%04x", \r
+               ConfigRequest,\r
+               StrLen,\r
+               L"%s&OFFSET=0&WIDTH=%04x",\r
                Storage->ConfigHdr,\r
                Storage->BrowserStorage->Size);\r
   } else {\r
@@ -5601,7 +5601,7 @@ LoadStorage (
     if (StrPtr != NULL) {\r
       *StrPtr = L'\0';\r
     }\r
-    \r
+\r
     Status = ConfigRespToStorage (Storage->BrowserStorage, Result);\r
     FreePool (Result);\r
   }\r
@@ -5609,7 +5609,7 @@ LoadStorage (
   Storage->BrowserStorage->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigRequest), Storage->ConfigRequest);\r
 \r
   //\r
-  // Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer. \r
+  // Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer.\r
   //\r
   SynchronizeStorage(Storage->BrowserStorage, NULL, TRUE);\r
 \r
@@ -5737,7 +5737,7 @@ InitializeCurrentSetting (
 \r
   //\r
   // Extract default from IFR binary for no storage questions.\r
-  //  \r
+  //\r
   ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormSetLevel, GetDefaultForNoStorage, NULL, TRUE, FALSE);\r
 \r
   //\r
@@ -5989,7 +5989,7 @@ InitializeFormSet (
 \r
 \r
 /**\r
-  Save globals used by previous call to SendForm(). SendForm() may be called from \r
+  Save globals used by previous call to SendForm(). SendForm() may be called from\r
   HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r
   So, save globals of previous call to SendForm() and restore them upon exit.\r
 \r
@@ -6134,13 +6134,13 @@ RestoreBrowserContext (
 \r
 /**\r
   Find the matched FormSet context in the backup maintain list based on HiiHandle.\r
-  \r
+\r
   @param Handle  The Hii Handle.\r
-  \r
+\r
   @return the found FormSet context. If no found, NULL will return.\r
 \r
 **/\r
-FORM_BROWSER_FORMSET * \r
+FORM_BROWSER_FORMSET *\r
 GetFormSetFromHiiHandle (\r
   EFI_HII_HANDLE Handle\r
   )\r
@@ -6159,15 +6159,15 @@ GetFormSetFromHiiHandle (
       return FormSet;\r
     }\r
   }\r
-  \r
+\r
   return NULL;\r
 }\r
 \r
 /**\r
   Check whether the input HII handle is the FormSet that is being used.\r
-  \r
+\r
   @param Handle  The Hii Handle.\r
-  \r
+\r
   @retval TRUE   HII handle is being used.\r
   @retval FALSE  HII handle is not being used.\r
 \r
@@ -6201,20 +6201,20 @@ IsHiiHandleInBrowserContext (
     }\r
     Link = GetNextNode (&gBrowserContextList, Link);\r
   }\r
-  \r
+\r
   return FALSE;\r
 }\r
 \r
 /**\r
-  Perform Password check. \r
+  Perform Password check.\r
   Passwork may be encrypted by driver that requires the specific check.\r
-  \r
+\r
   @param  Form             Form where Password Statement is in.\r
   @param  Statement        Password statement\r
   @param  PasswordString   Password string to be checked. It may be NULL.\r
                            NULL means to restore password.\r
                            "" string can be used to checked whether old password does exist.\r
-  \r
+\r
   @return Status     Status of Password check.\r
 **/\r
 EFI_STATUS\r
@@ -6245,7 +6245,7 @@ PasswordCheck (
     //\r
     return EFI_UNSUPPORTED;\r
   }\r
-    \r
+\r
   //\r
   // Prepare password string in HII database\r
   //\r
@@ -6279,7 +6279,7 @@ PasswordCheck (
 \r
 /**\r
   Find the registered HotKey based on KeyData.\r
-  \r
+\r
   @param[in] KeyData     A pointer to a buffer that describes the keystroke\r
                          information for the hot key.\r
 \r
@@ -6301,7 +6301,7 @@ GetHotKeyFromRegisterList (
     }\r
     Link = GetNextNode (&gBrowserHotKeyList, Link);\r
   }\r
-  \r
+\r
   return NULL;\r
 }\r
 \r
@@ -6310,11 +6310,11 @@ GetHotKeyFromRegisterList (
   All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r
   If no scope is set, the default scope will be FormSet level.\r
   After all registered hot keys are removed, previous Scope can reset to another level.\r
-  \r
-  @param[in] Scope               Scope level to be set. \r
-  \r
+\r
+  @param[in] Scope               Scope level to be set.\r
+\r
   @retval EFI_SUCCESS            Scope is set correctly.\r
-  @retval EFI_INVALID_PARAMETER  Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r
+  @retval EFI_INVALID_PARAMETER  Scope is not the valid value specified in BROWSER_SETTING_SCOPE.\r
   @retval EFI_UNSPPORTED         Scope level is different from current one that the registered hot keys have.\r
 \r
 **/\r
@@ -6347,15 +6347,15 @@ SetScope (
   Only support hot key that is not printable character (control key, function key, etc.).\r
   If the action value is zero, the hot key will be unregistered if it has been registered.\r
   If the same hot key has been registered, the new action and help string will override the previous ones.\r
-  \r
+\r
   @param[in] KeyData     A pointer to a buffer that describes the keystroke\r
-                         information for the hot key. Its type is EFI_INPUT_KEY to \r
+                         information for the hot key. Its type is EFI_INPUT_KEY to\r
                          be supported by all ConsoleIn devices.\r
-  @param[in] Action      Action value that describes what action will be trigged when the hot key is pressed. \r
+  @param[in] Action      Action value that describes what action will be trigged when the hot key is pressed.\r
   @param[in] DefaultId   Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r
   @param[in] HelpString  Help string that describes the hot key information.\r
                          Its value may be NULL for the unregistered hot key.\r
-  \r
+\r
   @retval EFI_SUCCESS            Hot key is registered or unregistered.\r
   @retval EFI_INVALID_PARAMETER  KeyData is NULL or HelpString is NULL on register.\r
   @retval EFI_NOT_FOUND          KeyData is not found to be unregistered.\r
@@ -6376,7 +6376,7 @@ RegisterHotKey (
   //\r
   // Check input parameters.\r
   //\r
-  if (KeyData == NULL || KeyData->UnicodeChar != CHAR_NULL || \r
+  if (KeyData == NULL || KeyData->UnicodeChar != CHAR_NULL ||\r
      (Action != BROWSER_ACTION_UNREGISTER && HelpString == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -6385,14 +6385,14 @@ RegisterHotKey (
   // Check whether the input KeyData is in BrowserHotKeyList.\r
   //\r
   HotKey = GetHotKeyFromRegisterList (KeyData);\r
-  \r
+\r
   //\r
   // Unregister HotKey\r
   //\r
   if (Action == BROWSER_ACTION_UNREGISTER) {\r
     if (HotKey != NULL) {\r
       //\r
-      // The registered HotKey is found.  \r
+      // The registered HotKey is found.\r
       // Remove it from List, and free its resource.\r
       //\r
       RemoveEntryList (&HotKey->Link);\r
@@ -6401,7 +6401,7 @@ RegisterHotKey (
       return EFI_SUCCESS;\r
     } else {\r
       //\r
-      // The registered HotKey is not found. \r
+      // The registered HotKey is not found.\r
       //\r
       return EFI_NOT_FOUND;\r
     }\r
@@ -6434,11 +6434,11 @@ RegisterHotKey (
 }\r
 \r
 /**\r
-  Register Exit handler function. \r
-  When more than one handler function is registered, the latter one will override the previous one. \r
-  When NULL handler is specified, the previous Exit handler will be unregistered. \r
-  \r
-  @param[in] Handler      Pointer to handler function. \r
+  Register Exit handler function.\r
+  When more than one handler function is registered, the latter one will override the previous one.\r
+  When NULL handler is specified, the previous Exit handler will be unregistered.\r
+\r
+  @param[in] Handler      Pointer to handler function.\r
 \r
 **/\r
 VOID\r
@@ -6510,7 +6510,7 @@ IsBrowserDataModified (
   @retval EFI_INVALID_PARAMETER    The input action value is invalid.\r
 \r
 **/\r
-EFI_STATUS \r
+EFI_STATUS\r
 EFIAPI\r
 ExecuteAction (\r
   IN UINT32        Action,\r
@@ -6530,7 +6530,7 @@ ExecuteAction (
   Form    = NULL;\r
   if (gBrowserSettingScope < SystemLevel) {\r
     FormSet = gCurrentSelection->FormSet;\r
-    Form    = gCurrentSelection->Form; \r
+    Form    = gCurrentSelection->Form;\r
   }\r
 \r
   //\r
@@ -6625,16 +6625,16 @@ SaveReminder (
       break;\r
     }\r
   }\r
-  \r
+\r
   //\r
-  // No data is changed. No save is required. \r
+  // No data is changed. No save is required.\r
   //\r
   if (!IsDataChanged) {\r
     return DataSavedAction;\r
   }\r
-  \r
+\r
   //\r
-  // If data is changed, prompt user to save or discard it. \r
+  // If data is changed, prompt user to save or discard it.\r
   //\r
   do {\r
     ConfirmRet = (UINT32) mFormDisplay->ConfirmDataChange();\r