From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7DCF8210EB13C for ; Fri, 10 Aug 2018 01:50:03 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2018 01:50:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,218,1531810800"; d="scan'208";a="61383083" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 10 Aug 2018 01:50:03 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 10 Aug 2018 01:50:02 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 10 Aug 2018 01:50:02 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Fri, 10 Aug 2018 16:50:01 +0800 From: "Zeng, Star" To: "Zhang, Shenglei" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg UiApp: Remove something redundant Thread-Index: AQHUL63P/W3guk0OUU2FA0u6H1vZCaS4rttA Date: Fri, 10 Aug 2018 08:50:00 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BBABE1A@shsmsx102.ccr.corp.intel.com> References: <20180809065346.33372-1-shenglei.zhang@intel.com> In-Reply-To: <20180809065346.33372-1-shenglei.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg UiApp: Remove something redundant X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 08:50:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I suggest merging this patch to thread https://lists.01.org/pipermail/edk2-= devel/2018-August/028167.html. Thanks, Star -----Original Message----- From: Zhang, Shenglei=20 Sent: Thursday, August 9, 2018 2:54 PM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Dong, Eric Subject: [PATCH] MdeModulePkg UiApp: Remove something redundant The "function IsResetReminderFeatureEnable()" and the variable "mFeaturerSwitch" have been removed.Because after last cleanup,the function always returns TRUE.And the "IF" expression has also been removed,whose condition judgment is "IsResetReminderFeatureEnable()". https://bugzilla.tianocore.org/show_bug.cgi?id=3D1062 Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei --- MdeModulePkg/Application/UiApp/FrontPage.c | 51 ++++++++-------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Appl= ication/UiApp/FrontPage.c index f0513deb51..650aea931d 100644 --- a/MdeModulePkg/Application/UiApp/FrontPage.c +++ b/MdeModulePkg/Application/UiApp/FrontPage.c @@ -20,7 +20,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. =20 EFI_GUID mFrontPageGuid =3D FRONT_PAGE_FORMSET_GUID; =20 -BOOLEAN mFeaturerSwitch =3D TRUE; BOOLEAN mResetRequired =3D FALSE; =20 EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2; @@ -1062,19 +1061,6 @@ EnableResetRequired ( =20 =20 =20 -/** - Check whether platform policy enable the reset reminder feature. The def= ault is enabled. - -**/ -BOOLEAN -EFIAPI -IsResetReminderFeatureEnable ( - VOID - ) -{ - return mFeaturerSwitch; -} - =20 /** Check if user changed any option setting which needs a system reset to = be effective. @@ -1106,31 +1092,28 @@ SetupResetReminder ( CHAR16 *StringBuffer1; CHAR16 *StringBuffer2; =20 - // //check any reset required change is applied? if yes, reset system // - if (IsResetReminderFeatureEnable ()) { - if (IsResetRequired ()) { - - StringBuffer1 =3D AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)= ); - ASSERT (StringBuffer1 !=3D NULL); - StringBuffer2 =3D AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)= ); - ASSERT (StringBuffer2 !=3D NULL); - StrCpyS (StringBuffer1, MAX_STRING_LEN, L"Configuration changed. Res= et to apply it Now."); - StrCpyS (StringBuffer2, MAX_STRING_LEN, L"Press ENTER to reset"); - // - // Popup a menu to notice user - // - do { - CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuff= er1, StringBuffer2, NULL); - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN); + if (IsResetRequired ()) { + + StringBuffer1 =3D AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + ASSERT (StringBuffer1 !=3D NULL); + StringBuffer2 =3D AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + ASSERT (StringBuffer2 !=3D NULL); + StrCpyS (StringBuffer1, MAX_STRING_LEN, L"Configuration changed. Reset= to apply it Now."); + StrCpyS (StringBuffer2, MAX_STRING_LEN, L"Press ENTER to reset"); + // + // Popup a menu to notice user + // + do { + CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuffer= 1, StringBuffer2, NULL); + } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN); =20 - FreePool (StringBuffer1); - FreePool (StringBuffer2); + FreePool (StringBuffer1); + FreePool (StringBuffer2); =20 - gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); - } + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } } =20 --=20 2.18.0.windows.1