From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (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 EBCD81A1E20 for ; Sun, 23 Oct 2016 21:45:46 -0700 (PDT) Received: from nwb-ext-pat.microfocus.com ([10.120.13.103]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 24 Oct 2016 06:45:45 +0200 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.201]) by nwb-ext-pat.microfocus.com with ESMTP (TLS encrypted); Mon, 24 Oct 2016 05:45:37 +0100 Date: Mon, 24 Oct 2016 12:45:28 +0800 From: Gary Lin To: Laszlo Ersek Cc: edk2-devel-01 , Anthony PERARD , Jordan Justen Message-ID: <20161024044528.vbvnly4dzbvbti4s@GaryWorkstation> References: <20161021212737.15974-1-lersek@redhat.com> <20161021212737.15974-6-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20161021212737.15974-6-lersek@redhat.com> User-Agent: Mutt/1.6.2 (2016-07-01) Subject: Re: [PATCH 05/19] OvmfPkg/PlatformBootManagerLib: eliminate unchecked PcdSetXX() calls X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 04:45:47 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 21, 2016 at 11:27:23PM +0200, Laszlo Ersek wrote: > These are deprecated / disabled under the > DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. > > Introduce a variable called PcdStatus, and use it to assert the success of > these operations (there is no reason for them to fail here). > Reviewed-by: Gary Lin and Tested-by: Gary Lin > Cc: Anthony PERARD > Cc: Gary Lin > Cc: Jordan Justen > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek > --- > > Notes: > the emulated variable part of the patch is un-exercised on my setup, > testing would be appreciated > > OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > index bd1a4396f1d3..29ce21282595 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > @@ -353,8 +353,9 @@ Returns: > > --*/ > { > - EFI_HANDLE Handle; > - EFI_STATUS Status; > + EFI_HANDLE Handle; > + EFI_STATUS Status; > + RETURN_STATUS PcdStatus; > > DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n")); > InstallDevicePathCallback (); > @@ -394,7 +395,9 @@ Returns: > ASSERT_EFI_ERROR (Status); > > PlatformInitializeConsole (gPlatformConsole); > - PcdSet16 (PcdPlatformBootTimeOut, GetFrontPageTimeoutFromQemu ()); > + PcdStatus = PcdSet16S (PcdPlatformBootTimeOut, > + GetFrontPageTimeoutFromQemu ()); > + ASSERT_RETURN_ERROR (PcdStatus); > > PlatformRegisterOptionsAndKeys (); > } > @@ -1281,6 +1284,7 @@ VisitingFileSystemInstance ( > { > EFI_STATUS Status; > STATIC BOOLEAN ConnectedToFileSystem = FALSE; > + RETURN_STATUS PcdStatus; > > if (ConnectedToFileSystem) { > return EFI_ALREADY_STARTED; > @@ -1300,7 +1304,9 @@ VisitingFileSystemInstance ( > NULL, > &mEmuVariableEventReg > ); > - PcdSet64 (PcdEmuVariableEvent, (UINT64)(UINTN) mEmuVariableEvent); > + PcdStatus = PcdSet64S (PcdEmuVariableEvent, > + (UINT64)(UINTN) mEmuVariableEvent); > + ASSERT_RETURN_ERROR (PcdStatus); > > return EFI_SUCCESS; > } > -- > 2.9.2 > > >