From: "Daniel Schaefer" <daniel.schaefer@hpe.com>
To: Abner Chang <abner.chang@hpe.com>, <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>
Subject: Re: [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: Error handling for locating firmware context
Date: Fri, 11 Sep 2020 15:59:00 +0800 [thread overview]
Message-ID: <556055a0-5056-7949-903f-0f17999fa855@hpe.com> (raw)
In-Reply-To: <20200908054844.25755-1-abner.chang@hpe.com>
Oh no, what did I do here... I don't return proper error codes at all in this file.
I forgot to revise this after the initial implementation.
So, good change but we should do that for all functions in this file.
I'll do that on Monday.
On 9/8/20 1:48 PM, Abner Chang wrote:
> Return EFI_NOT_FOUND if opensbi firmware context can not be
> located using SBI call.
>
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> ---
> .../ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c
> index 0df505d267..64c30b950d 100644
> --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c
> +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c
> @@ -851,6 +851,8 @@ SbiGetMscratchHartid (
>
> @param[out] FirmwareContext The firmware context pointer.
> @retval EFI_SUCCESS The operation succeeds.
> + @retval EFI_NOT_FOUND Failed to get the pointer of EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT.
> +
> **/
> EFI_STATUS
> EFIAPI
> @@ -866,8 +868,9 @@ SbiGetFirmwareContext (
> ScratchSpace = (SBI_SCRATCH *)Ret.Value;
> SbiPlatform = (SBI_PLATFORM *)sbi_platform_ptr(ScratchSpace);
> *FirmwareContext = (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)SbiPlatform->firmware_context;
> + } else {
> + return EFI_NOT_FOUND;
> }
> -
> return EFI_SUCCESS;
> }
>
>
next prev parent reply other threads:[~2020-09-11 7:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-08 5:48 [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: Error handling for locating firmware context Abner Chang
2020-09-08 5:48 ` [edk2-platforms][PATCH 2/2] Silicon/SiFive: " Abner Chang
2020-09-11 8:01 ` Daniel Schaefer
2020-09-12 6:33 ` Abner Chang
2020-09-11 7:59 ` Daniel Schaefer [this message]
2020-09-12 6:29 ` [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: " Abner Chang
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=556055a0-5056-7949-903f-0f17999fa855@hpe.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