From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 0E2E9210F52BD for ; Sun, 19 Aug 2018 21:55:31 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2018 21:55:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,263,1531810800"; d="scan'208";a="84720079" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 19 Aug 2018 21:55:30 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 19 Aug 2018 21:55:30 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 19 Aug 2018 21:55:29 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.240]) with mapi id 14.03.0319.002; Mon, 20 Aug 2018 12:55:27 +0800 From: "Zeng, Star" To: "Zhang, Shenglei" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Zeng, Star" Thread-Topic: [PATCH v2 27/27] MdeModulePkg UiApp: Remove a redundant function and a variable Thread-Index: AQHUNDn2z5dNM3xlXE2vEWph+4OVVqTIG37Q Date: Mon, 20 Aug 2018 04:55:26 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BBAF4A9@shsmsx102.ccr.corp.intel.com> References: <20180815014609.19948-1-shenglei.zhang@intel.com> <20180815014609.19948-28-shenglei.zhang@intel.com> In-Reply-To: <20180815014609.19948-28-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 v2 27/27] MdeModulePkg UiApp: Remove a redundant function and a variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 04:55:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Zhang, Shenglei=20 Sent: Wednesday, August 15, 2018 9:46 AM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Dong, Eric Subject: [PATCH v2 27/27] MdeModulePkg UiApp: Remove a redundant function a= nd a variable 1.After the cleanup at "MdeModulePkg UiApp: Remove redundant functions", the function "IsResetReminderFeatureEnable()" and the variable "mFeaturerSwitch" become redundant so they have been removed. 2.Therefore, the "IF" expression has also been removed, whose judgment cond= ition 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