]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmHotkey.c
index efad073880ae040a73aa79448c1f57a4091ca657..f799117c93ae3e426a42d8362ebd0f845e38a593 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Hotkey library functions.\r
 \r
-Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -116,7 +116,7 @@ BmIsKeyOptionVariable (
 {\r
   UINTN         Index;\r
   UINTN         Uint;\r
-  \r
+\r
   if (!CompareGuid (Guid, &gEfiGlobalVariableGuid) ||\r
       (StrSize (Name) != sizeof (L"Key####")) ||\r
       (StrnCmp (Name, L"Key", 3) != 0)\r
@@ -375,7 +375,7 @@ BmHotkeyCallback (
     HotkeyData = &Hotkey->KeyData[Hotkey->WaitingKey];\r
     if ((KeyData->Key.ScanCode == HotkeyData->Key.ScanCode) &&\r
         (KeyData->Key.UnicodeChar == HotkeyData->Key.UnicodeChar) &&\r
-        (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) ? \r
+        (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) ?\r
           (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE\r
         )\r
        ) {\r
@@ -799,7 +799,7 @@ EfiBootManagerRegisterContinueKeyOption (
   EFI_STATUS                   Status;\r
   EFI_BOOT_MANAGER_KEY_OPTION  KeyOption;\r
   VA_LIST                      Args;\r
-  \r
+\r
   if (mBmContinueKeyOption != NULL) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
@@ -822,7 +822,7 @@ EfiBootManagerRegisterContinueKeyOption (
 \r
 /**\r
   Stop the hotkey processing.\r
-  \r
+\r
   @param    Event          Event pointer related to hotkey service.\r
   @param    Context        Context pass to this function.\r
 **/\r
@@ -852,7 +852,7 @@ BmStopHotkeyService (
 /**\r
   Start the hot key service so that the key press can trigger the boot option.\r
 \r
-  @param HotkeyTriggered  Return the waitable event and it will be signaled \r
+  @param HotkeyTriggered  Return the waitable event and it will be signaled\r
                           when a valid hot key is pressed.\r
 \r
   @retval EFI_SUCCESS     The hot key service is started.\r
@@ -870,13 +870,13 @@ EfiBootManagerStartHotkeyService (
   EFI_EVENT                    Event;\r
   UINT32                       *BootOptionSupport;\r
 \r
-  Status = GetEfiGlobalVariable2 (EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, (VOID **) &BootOptionSupport, NULL);\r
-  ASSERT (BootOptionSupport != NULL);\r
-\r
-  if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY)  != 0) {\r
-    mBmHotkeySupportCount = ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT));\r
+  GetEfiGlobalVariable2 (EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, (VOID **) &BootOptionSupport, NULL);\r
+  if (BootOptionSupport != NULL) {\r
+    if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY)  != 0) {\r
+      mBmHotkeySupportCount = ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT));\r
+    }\r
+    FreePool (BootOptionSupport);\r
   }\r
-  FreePool (BootOptionSupport);\r
 \r
   if (mBmHotkeySupportCount == 0) {\r
     DEBUG ((EFI_D_INFO, "Bds: BootOptionSupport NV variable forbids starting the hotkey service.\n"));\r