]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Debugger/Debugport/Dxe/DebugPort.c
Clean up the gBS sevice (CopyMem, SetMem, AllocatePool, FreePool) with the correspond...
[mirror_edk2.git] / EdkModulePkg / Universal / Debugger / Debugport / Dxe / DebugPort.c
index 88d19d4ad0106ec5f720ccbfd9de1503dd5f1a57..a15ec1cb30a4d5a4d24105e97d4e0abd3a8f807b 100644 (file)
@@ -67,7 +67,7 @@ Returns:
 \r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     if (gDebugPortDevice->DebugPortVariable != NULL) {\r
-      gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
+      FreePool (gDebugPortDevice->DebugPortVariable);\r
     }\r
 \r
     DebugPortDevice->DebugPortVariable = AllocatePool (DataSize);\r
@@ -85,31 +85,31 @@ Returns:
       }\r
 \r
       if (EfiIsDevicePathEnd (DevicePath)) {\r
-        gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
+        FreePool (gDebugPortDevice->DebugPortVariable);\r
         DebugPortDevice->DebugPortVariable = NULL;\r
       } else {\r
-        gBS->CopyMem (\r
-              &DebugPortDevice->BaudRate,\r
-              &((UART_DEVICE_PATH *) DevicePath)->BaudRate,\r
-              sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)\r
-              );\r
+        CopyMem (\r
+          &DebugPortDevice->BaudRate,\r
+          &((UART_DEVICE_PATH *) DevicePath)->BaudRate,\r
+          sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)\r
+          );\r
         DebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;\r
         DebugPortDevice->Timeout          = DEBUGPORT_UART_DEFAULT_TIMEOUT;\r
-        gBS->CopyMem (\r
-              &DebugPortDevice->Parity,\r
-              &((UART_DEVICE_PATH *) DevicePath)->Parity,\r
-              sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)\r
-              );\r
-        gBS->CopyMem (\r
-              &DebugPortDevice->DataBits,\r
-              &((UART_DEVICE_PATH *) DevicePath)->DataBits,\r
-              sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)\r
-              );\r
-        gBS->CopyMem (\r
-              &DebugPortDevice->StopBits,\r
-              &((UART_DEVICE_PATH *) DevicePath)->StopBits,\r
-              sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)\r
-              );\r
+        CopyMem (\r
+          &DebugPortDevice->Parity,\r
+          &((UART_DEVICE_PATH *) DevicePath)->Parity,\r
+          sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)\r
+          );\r
+        CopyMem (\r
+          &DebugPortDevice->DataBits,\r
+          &((UART_DEVICE_PATH *) DevicePath)->DataBits,\r
+          sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)\r
+          );\r
+        CopyMem (\r
+          &DebugPortDevice->StopBits,\r
+          &((UART_DEVICE_PATH *) DevicePath)->StopBits,\r
+          sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)\r
+          );\r
       }\r
     }\r
   }\r
@@ -273,7 +273,7 @@ Returns:
       Status = EFI_UNSUPPORTED;\r
     }\r
 \r
-    gBS->FreePool (Dp1);\r
+    FreePool (Dp1);\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
@@ -389,7 +389,7 @@ Returns:
   DebugPortDP.Header.Type     = MESSAGING_DEVICE_PATH;\r
   DebugPortDP.Header.SubType  = MSG_VENDOR_DP;\r
   SetDevicePathNodeLength (&(DebugPortDP.Header), sizeof (DebugPortDP));\r
-  gBS->CopyMem (&DebugPortDP.Guid, &gEfiDebugPortDevicePathGuid, sizeof (EFI_GUID));\r
+  CopyMem (&DebugPortDP.Guid, &gEfiDebugPortDevicePathGuid, sizeof (EFI_GUID));\r
 \r
   Dp1 = DevicePathFromHandle (ControllerHandle);\r
   if (Dp1 == NULL) {\r
@@ -516,7 +516,7 @@ Returns:
           ControllerHandle\r
           );\r
 \r
-    gBS->FreePool (gDebugPortDevice->DebugPortDevicePath);\r
+    FreePool (gDebugPortDevice->DebugPortDevicePath);\r
 \r
     return EFI_SUCCESS;\r
   } else {\r
@@ -803,10 +803,10 @@ Returns:
   // Clean up allocations\r
   //\r
   if (gDebugPortDevice->DebugPortVariable != NULL) {\r
-    gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
+    FreePool (gDebugPortDevice->DebugPortVariable);\r
   }\r
 \r
-  gBS->FreePool (gDebugPortDevice);\r
+  FreePool (gDebugPortDevice);\r
 \r
   return EFI_SUCCESS;\r
 }\r