]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / DebugPortDxe / DebugPort.c
index 984288e30267a6e0c12761db8098cad01895e657..c3e7db4c42c02d77ef734a4d98eaad3932317074 100644 (file)
@@ -4,14 +4,8 @@
   ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM\r
   INTERRUPT CONTEXT\r
 \r
-Copyright (c) 2006 - 2014, 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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -65,7 +59,7 @@ GetDebugPortVariable (
   EFI_DEVICE_PATH_PROTOCOL  *DebugPortVariable;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
 \r
-  GetVariable2 (EFI_DEBUGPORT_VARIABLE_NAME, &gEfiDebugPortVariableGuid, &DebugPortVariable, &DataSize);\r
+  GetVariable2 (EFI_DEBUGPORT_VARIABLE_NAME, &gEfiDebugPortVariableGuid, (VOID **) &DebugPortVariable, &DataSize);\r
   if (DebugPortVariable == NULL) {\r
     return NULL;\r
   }\r
@@ -142,7 +136,7 @@ InitializeDebugPortDriver (
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -241,14 +235,14 @@ DebugPortSupported (
     return Status;\r
   }\r
 \r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiSerialIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
+  Status = gBS->CloseProtocol (\r
+                  ControllerHandle,\r
+                  &gEfiSerialIoProtocolGuid,\r
+                  This->DriverBindingHandle,\r
+                  ControllerHandle\r
+                  );\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -569,7 +563,7 @@ DebugPortRead (
     LocalBufferSize = *BufferSize - (BufferPtr - (UINT8 *) Buffer);\r
   } while (LocalBufferSize != 0 && Timeout > 0);\r
 \r
-  *BufferSize = (UINTN) (BufferPtr - (UINT8 *) Buffer);\r
+  *BufferSize = (UINTN) BufferPtr - (UINTN) Buffer;\r
 \r
   return Status;\r
 }\r