From: "Gary Lin" <glin@suse.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Zailiang Sun <zailiang.sun@intel.com>,
Yi Qian <yi.qian@intel.com>,
Michael D Kinney <michael.d.kinney@intel.com>
Subject: [PATCH edk2-platforms 4/4] Vlv2TbltDevicePkg: Clean up the unused variables and function
Date: Fri, 26 Jul 2019 07:06:43 +0000 [thread overview]
Message-ID: <20190726070612.3649-5-glin@suse.com> (raw)
In-Reply-To: <20190726070612.3649-1-glin@suse.com>
In PlatformBootOption.c:
* mContinueBoot and mBootMenuBoot were assigned as "!EnterSetup" before
being used. However, EnterSetup is always "FALSE", so it's meaningless
to keep those variables.
* mPxeBoot is defined but never used.
* DetectKeypressCallback() is never used. So we can remove it altogether
with mHotKeypressed and HotKeyEvent.
Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
---
Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/PlatformBootOption.c | 57 ++++----------------
1 file changed, 11 insertions(+), 46 deletions(-)
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/PlatformBootOption.c b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/PlatformBootOption.c
index a73d54a97d..539127e93f 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/PlatformBootOption.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/PlatformBootOption.c
@@ -10,12 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/PcdLib.h>
-BOOLEAN mContinueBoot = FALSE;
-BOOLEAN mBootMenuBoot = FALSE;
-BOOLEAN mPxeBoot = FALSE;
-BOOLEAN mHotKeypressed = FALSE;
-EFI_EVENT HotKeyEvent = NULL;
-
UINTN mBootMenuOptionNumber;
EFI_DEVICE_PATH_PROTOCOL *
@@ -396,21 +390,6 @@ RegisterBootOptionHotkey (
}
}
-EFI_STATUS
-EFIAPI
-DetectKeypressCallback (
- IN EFI_KEY_DATA *KeyData
-)
-{
- mHotKeypressed = TRUE;
-
- if (HotKeyEvent != NULL) {
- gBS->SignalEvent(HotKeyEvent);
- }
-
- return EFI_SUCCESS;
-}
-
/**
This function is called after all the boot options are enumerated and ordered properly.
**/
@@ -419,46 +398,32 @@ RegisterStaticHotkey (
VOID
)
{
-
EFI_INPUT_KEY Enter;
- EFI_KEY_DATA F2;
- EFI_KEY_DATA F7;
- BOOLEAN EnterSetup;
+ EFI_INPUT_KEY F2;
+ EFI_INPUT_KEY F7;
EFI_STATUS Status;
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
- EnterSetup = FALSE;
-
//
// [Enter]
//
- mContinueBoot = !EnterSetup;
- if (mContinueBoot) {
- Enter.ScanCode = SCAN_NULL;
- Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;
- EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);
- }
-
+ Enter.ScanCode = SCAN_NULL;
+ Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;
+ EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);
//
// [F2]/[F7]
//
- F2.Key.ScanCode = SCAN_F2;
- F2.Key.UnicodeChar = CHAR_NULL;
- F2.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;
- F2.KeyState.KeyToggleState = 0;
+ F2.ScanCode = SCAN_F2;
+ F2.UnicodeChar = CHAR_NULL;
Status = EfiBootManagerGetBootManagerMenu (&BootOption);
ASSERT_EFI_ERROR (Status);
- RegisterBootOptionHotkey ((UINT16) BootOption.OptionNumber, &F2.Key, TRUE);
+ RegisterBootOptionHotkey ((UINT16) BootOption.OptionNumber, &F2, TRUE);
EfiBootManagerFreeLoadOption (&BootOption);
- F7.Key.ScanCode = SCAN_F7;
- F7.Key.UnicodeChar = CHAR_NULL;
- F7.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;
- F7.KeyState.KeyToggleState = 0;
- mBootMenuBoot = !EnterSetup;
- RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7.Key, mBootMenuBoot);
-
+ F7.ScanCode = SCAN_F7;
+ F7.UnicodeChar = CHAR_NULL;
+ RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7, TRUE);
}
UINT8
--
2.22.0
next prev parent reply other threads:[~2019-07-26 7:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-26 7:06 [PATCH edk2-platforms 0/4] Fix the boot order and the boot menu Gary Lin
2019-07-26 7:06 ` [PATCH edk2-platforms 1/4] Vlv2TbltDevicePkg: Adjust the device priority Gary Lin
2019-07-26 7:06 ` [PATCH edk2-platforms 2/4] Vlv2TbltDevicePkg: Add the missing BootManagerMenuApp Gary Lin
2019-07-26 7:06 ` [PATCH edk2-platforms 3/4] Vlv2TbltDevicePkg: Only sort boot options when necessary Gary Lin
2019-07-26 7:06 ` Gary Lin [this message]
[not found] ` <15B4E359C7942CB9.8182@groups.io>
2019-07-26 7:35 ` [edk2-devel] [PATCH edk2-platforms 2/4] Vlv2TbltDevicePkg: Add the missing BootManagerMenuApp Gary Lin
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=20190726070612.3649-5-glin@suse.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