]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
MdeModulePkg/UefiBootManagerLib: Generate boot description for NVME
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmLoadOption.c
index 9af98de0afaf9097b57d5ffacdf89ab9d14f25f2..116cf28fe388ddf24c1094071645463819626af3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Load option library functions which relate with creating and processing load options.\r
 \r
-Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015-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
@@ -796,7 +796,7 @@ EfiBootManagerIsValidLoadOptionVariableName (
     return FALSE;\r
   }\r
 \r
-  for (Index = 0; Index < sizeof (mBmLoadOptionName) / sizeof (mBmLoadOptionName[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mBmLoadOptionName); Index++) {\r
     if ((VariableNameLen - 4 == StrLen (mBmLoadOptionName[Index])) &&\r
         (StrnCmp (VariableName, mBmLoadOptionName[Index], VariableNameLen - 4) == 0)\r
         ) {\r
@@ -804,7 +804,7 @@ EfiBootManagerIsValidLoadOptionVariableName (
     }\r
   }\r
 \r
-  if (Index == sizeof (mBmLoadOptionName) / sizeof (mBmLoadOptionName[0])) {\r
+  if (Index == ARRAY_SIZE (mBmLoadOptionName)) {\r
     return FALSE;\r
   }\r
 \r
@@ -912,7 +912,7 @@ EfiBootManagerVariableToLoadOptionEx (
   FilePath = (EFI_DEVICE_PATH_PROTOCOL *) VariablePtr;\r
   VariablePtr += FilePathSize;\r
 \r
-  OptionalDataSize = (UINT32) (VariableSize - (UINTN) (VariablePtr - Variable));\r
+  OptionalDataSize = (UINT32) (VariableSize - ((UINTN) VariablePtr - (UINTN) Variable));\r
   if (OptionalDataSize == 0) {\r
     OptionalData = NULL;\r
   } else {\r
@@ -1277,8 +1277,9 @@ EfiBootManagerProcessLoadOption (
   // Load and start the load option.\r
   //\r
   DEBUG ((\r
-    DEBUG_INFO | DEBUG_LOAD, "Process Load Option (%s%04x) ...\n",\r
-    mBmLoadOptionName[LoadOption->OptionType], LoadOption->OptionNumber\r
+    DEBUG_INFO | DEBUG_LOAD, "Process %s%04x (%s) ...\n",\r
+    mBmLoadOptionName[LoadOption->OptionType], LoadOption->OptionNumber,\r
+    LoadOption->Description\r
     ));\r
   ImageHandle = NULL;\r
   FileBuffer = EfiBootManagerGetLoadOptionBuffer (LoadOption->FilePath, &FilePath, &FileSize);\r
@@ -1321,7 +1322,7 @@ EfiBootManagerProcessLoadOption (
 \r
     LoadOption->Status = gBS->StartImage (ImageHandle, &LoadOption->ExitDataSize, &LoadOption->ExitData);\r
     DEBUG ((\r
-      DEBUG_INFO | DEBUG_LOAD, "Load Option (%s%04x) Return Status = %r\n",\r
+      DEBUG_INFO | DEBUG_LOAD, "%s%04x Return Status = %r\n",\r
       mBmLoadOptionName[LoadOption->OptionType], LoadOption->OptionNumber, LoadOption->Status\r
       ));\r
 \r