summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-03-14 14:37:55 +0800
committerFeng Tian <feng.tian@intel.com>2016-03-16 10:41:25 +0800
commitc7d310dd169ef84eee1ffab3af763372a363ab4b (patch)
tree5e44a55e5b67a18b84fd76d0d7c85e667323a807
parent41c244b6b992aa39086ab258f4383c8daf85c3b3 (diff)
downloadedk2-c7d310dd169ef84eee1ffab3af763372a363ab4b.tar.gz
MdeModulePkg: Refine the UI code
Remove the ASSERT in UI code that may be triggered, and clean up the useless code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
-rw-r--r--MdeModulePkg/Application/UiApp/FrontPage.c7
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c15
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h10
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c56
4 files changed, 17 insertions, 71 deletions
diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Application/UiApp/FrontPage.c
index 5c67a3fa9..9cc877bed 100644
--- a/MdeModulePkg/Application/UiApp/FrontPage.c
+++ b/MdeModulePkg/Application/UiApp/FrontPage.c
@@ -1,7 +1,7 @@
/** @file
FrontPage routines to handle the callbacks and browser calls
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -420,7 +420,10 @@ FrontPageCallback (
AsciiStrSize (Lang),
Lang
);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR (Status)) {
+ FreePool (Lang);
+ return EFI_DEVICE_ERROR;
+ }
} else {
ASSERT (FALSE);
}
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
index 8189bd108..745f97155 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
@@ -1,7 +1,7 @@
/** @file
The functions for Boot Maintainence Main menu.
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -667,8 +667,17 @@ BootMaintRouteConfig (
sizeof(UINT16),
&(NewBmmData->BootTimeOut)
);
- ASSERT_EFI_ERROR(Status);
-
+ if (EFI_ERROR (Status)) {
+ //
+ // If set variable fail, and don't have the appropriate error status for RouteConfig fuction to return,
+ // just return the EFI_NOT_FOUND.
+ //
+ if (Status == EFI_OUT_OF_RESOURCES) {
+ return Status;
+ } else {
+ return EFI_NOT_FOUND;
+ }
+ }
Private->BmmOldFakeNVData.BootTimeOut = NewBmmData->BootTimeOut;
}
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
index b482bf289..2c93446a0 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
@@ -764,16 +764,6 @@ Var_UpdateOutOfBandOption (
);
/**
- Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new BaudRate, Data Bits,
- parity and stop Bits set.
-
-**/
-VOID
-Var_UpdateAllConsoleOption (
- VOID
- );
-
-/**
This function update the "BootNext" EFI Variable. If there is no "BootNex" specified in BMM,
this EFI Variable is deleted.
It also update the BMM context data specified the "BootNext" value.
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
index 2ecf5b660..b65d6a5c9 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
@@ -301,62 +301,6 @@ Var_ChangeDriverOrder (
}
/**
- Update the device path of "ConOut", "ConIn" and "ErrOut"
- based on the new BaudRate, Data Bits, parity and Stop Bits
- set.
-
-**/
-VOID
-Var_UpdateAllConsoleOption (
- VOID
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *OutDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *InpDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *ErrDevicePath;
- EFI_STATUS Status;
-
- GetEfiGlobalVariable2 (L"ConOut", (VOID**)&OutDevicePath, NULL);
- GetEfiGlobalVariable2 (L"ConIn", (VOID**)&InpDevicePath, NULL);
- GetEfiGlobalVariable2 (L"ErrOut", (VOID**)&ErrDevicePath, NULL);
- if (OutDevicePath != NULL) {
- ChangeVariableDevicePath (OutDevicePath);
- Status = gRT->SetVariable (
- L"ConOut",
- &gEfiGlobalVariableGuid,
- VAR_FLAG,
- GetDevicePathSize (OutDevicePath),
- OutDevicePath
- );
- ASSERT (!EFI_ERROR (Status));
- }
-
- if (InpDevicePath != NULL) {
- ChangeVariableDevicePath (InpDevicePath);
- Status = gRT->SetVariable (
- L"ConIn",
- &gEfiGlobalVariableGuid,
- VAR_FLAG,
- GetDevicePathSize (InpDevicePath),
- InpDevicePath
- );
- ASSERT (!EFI_ERROR (Status));
- }
-
- if (ErrDevicePath != NULL) {
- ChangeVariableDevicePath (ErrDevicePath);
- Status = gRT->SetVariable (
- L"ErrOut",
- &gEfiGlobalVariableGuid,
- VAR_FLAG,
- GetDevicePathSize (ErrDevicePath),
- ErrDevicePath
- );
- ASSERT (!EFI_ERROR (Status));
- }
-}
-
-/**
This function delete and build multi-instance device path for
specified type of console device.