]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
IntelFrameworkModulePkg: Refine type cast for pointer subtraction
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / BdsConsole.c
index 84e4a0e6be2d9cc07e348414b826428d8de42db7..8f273ff1b1eaaf44ad95ee2dd2655a81405db33f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -65,9 +65,9 @@ IsNvNeed (
   @param  VarName            The name of the EFI console variable.\r
   @param  ConsoleGuid        Specified Console protocol GUID.\r
   @param  ConsoleHandle      On IN,  console handle in System Table to be checked. \r
-                             On OUT, new console hanlde in system table.\r
+                             On OUT, new console handle in system table.\r
   @param  ProtocolInterface  On IN,  console protocol on console handle in System Table to be checked. \r
-                             On OUT, new console protocol on new console hanlde in system table.\r
+                             On OUT, new console protocol on new console handle in system table.\r
 \r
   @retval TRUE               System Table has been updated.\r
   @retval FALSE              System Table hasn't been updated.\r
@@ -285,17 +285,16 @@ BdsLibUpdateConsoleVariable (
   // Finally, Update the variable of the default console by NewDevicePath\r
   //\r
   DevicePathSize = GetDevicePathSize (NewDevicePath);\r
-  Status = gRT->SetVariable (\r
-                  ConVarName,\r
-                  &gEfiGlobalVariableGuid,\r
-                  Attributes,\r
-                  DevicePathSize,\r
-                  NewDevicePath\r
-                  );\r
+  Status = SetVariableAndReportStatusCodeOnError (\r
+             ConVarName,\r
+             &gEfiGlobalVariableGuid,\r
+             Attributes,\r
+             DevicePathSize,\r
+             NewDevicePath\r
+             );\r
   if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) {\r
     Status = EFI_SUCCESS;\r
   }\r
-  ASSERT_EFI_ERROR (Status);\r
 \r
   if (VarConsole == NewDevicePath) {\r
     if (VarConsole != NULL) {\r
@@ -870,12 +869,11 @@ ConvertBmpToGopBlt (
           *GopBlt = NULL;\r
         }\r
         return EFI_UNSUPPORTED;\r
-        break;\r
       };\r
 \r
     }\r
 \r
-    ImageIndex = (UINTN) (Image - ImageHeader);\r
+    ImageIndex = (UINTN)Image - (UINTN)ImageHeader;\r
     if ((ImageIndex % 4) != 0) {\r
       //\r
       // Bmp Image starts each row on a 32-bit boundary!\r