public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Benjamin Doron" <benjamin.doron00@gmail.com>
To: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms][PATCH v1] BoardModulePkg/BoardBdsHookLib: Fix mSetupOptionNumber check
Date: Sat, 28 Aug 2021 15:42:05 -0400	[thread overview]
Message-ID: <20210828194205.6083-1-benjamin.doron00@gmail.com> (raw)

If CreateFvBootOption() fails, RegisterFvBootOption() will return
LoadOptionNumberUnassigned, which is non-zero. Therefore, correct the
check when attempting to register hotkeys, to be able to detect if UiApp
is not present.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
index a07abb214913..1fd0de3961cc 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
@@ -440,7 +440,7 @@ RegisterStaticHotkey (
   //
   // [F2]/[F7]
   //
-  if (mSetupOptionNumber) {
+  if (mSetupOptionNumber != LoadOptionNumberUnassigned) {
     F2.Key.ScanCode    = SCAN_F2;
     F2.Key.UnicodeChar = CHAR_NULL;
     F2.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;
-- 
2.31.1


             reply	other threads:[~2021-08-28 19:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28 19:42 Benjamin Doron [this message]
2021-08-29  1:27 ` [edk2-devel] [edk2-platforms][PATCH v1] BoardModulePkg/BoardBdsHookLib: Fix mSetupOptionNumber check Nate DeSimone
2021-08-29  1:32 ` Nate DeSimone

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=20210828194205.6083-1-benjamin.doron00@gmail.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