From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: Tapan Shah <tapandshah@hpe.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: [PATCH] ShellPkg: Move UnicodeCollation2 Protcol locate out of UefiShellLib constructor
Date: Wed, 5 Oct 2016 22:20:26 +0000 [thread overview]
Message-ID: <CB6E33457884FA40993F35157061515C54A84568@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <1475701085-11860-1-git-send-email-tapandshah@hpe.com>
And pushed.
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> -----Original Message-----
> From: Tapan Shah [mailto:tapandshah@hpe.com]
> Sent: Wednesday, October 05, 2016 1:58 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Tapan Shah
> <tapandshah@hpe.com>
> Subject: [PATCH] ShellPkg: Move UnicodeCollation2 Protcol locate out of
> UefiShellLib constructor
> Importance: High
>
> Move gEfiUnicodeCollation2ProtocolGuid protocol outside of UefiShellLib
> constructor
> function.
> Locate gEfiUnicodeCollation2ProtocolGuid protocol in
> ShellOpenFileByName() which
> consumes this protocol API.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Tapan Shah <tapandshah@hpe.com>
> ---
> ShellPkg/Library/UefiShellLib/UefiShellLib.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index e47d535..53f54e1 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -292,18 +292,12 @@ ShellLibConstructor (
> IN EFI_SYSTEM_TABLE *SystemTable
> )
> {
> - EFI_STATUS Status;
> -
> mEfiShellEnvironment2 = NULL;
> gEfiShellProtocol = NULL;
> gEfiShellParametersProtocol = NULL;
> mEfiShellInterface = NULL;
> mEfiShellEnvironment2Handle = NULL;
> -
> - if (mUnicodeCollationProtocol == NULL) {
> - Status = gBS->LocateProtocol (&gEfiUnicodeCollation2ProtocolGuid, NULL,
> (VOID**)&mUnicodeCollationProtocol);
> - ASSERT_EFI_ERROR (Status);
> - }
> + mUnicodeCollationProtocol = NULL;
>
> //
> // verify that auto initialize is not set false
> @@ -730,6 +724,14 @@ ShellOpenFileByName(
> FileHandle,
> OpenMode);
>
> + if (mUnicodeCollationProtocol == NULL) {
> + Status = gBS->LocateProtocol (&gEfiUnicodeCollation2ProtocolGuid,
> NULL, (VOID**)&mUnicodeCollationProtocol);
> + if (EFI_ERROR (Status)) {
> + gEfiShellProtocol->CloseFile (*FileHandle);
> + return Status;
> + }
> + }
> +
> if ((mUnicodeCollationProtocol->StriColl (mUnicodeCollationProtocol,
> (CHAR16*)FileName, L"NUL") != 0) &&
> (mUnicodeCollationProtocol->StriColl (mUnicodeCollationProtocol,
> (CHAR16*)FileName, L"NULL") != 0) &&
> !EFI_ERROR(Status) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0)){
> --
> 1.9.5.msysgit.0
next prev parent reply other threads:[~2016-10-05 23:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 20:58 [PATCH] ShellPkg: Move UnicodeCollation2 Protcol locate out of UefiShellLib constructor Tapan Shah
2016-10-05 22:20 ` Carsey, Jaben [this message]
2016-10-06 19:57 ` Vladimir Olovyannikov
2016-10-06 20:05 ` Shah, Tapan
2016-10-06 20:07 ` Vladimir Olovyannikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CB6E33457884FA40993F35157061515C54A84568@FMSMSX103.amr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox