]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioScsiDxe/VirtioScsi.c
OvmfPkg:Fix VS2012 build failure
[mirror_edk2.git] / OvmfPkg / VirtioScsiDxe / VirtioScsi.c
index 7b8c3d22c8de322611f1ac42e5f8573c51cac93a..e773ecf7cc009dbe39056610cf93fd6704586420 100644 (file)
@@ -26,7 +26,7 @@
     unreasonable for now.\r
 \r
   Copyright (C) 2012, Red Hat, Inc.\r
-  Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2017, AMD Inc, All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
@@ -455,6 +455,15 @@ VirtioScsiPassThru (
   UINTN                     InDataNumPages;\r
   BOOLEAN                   OutDataBufferIsMapped;\r
 \r
+  //\r
+  // Set InDataMapping,OutDataMapping,InDataDeviceAddress and OutDataDeviceAddress to\r
+  // suppress incorrect compiler/analyzer warnings.\r
+  //\r
+  InDataMapping        = NULL;\r
+  OutDataMapping       = NULL;\r
+  InDataDeviceAddress  = 0;\r
+  OutDataDeviceAddress = 0;\r
+\r
   ZeroMem ((VOID*) &Request, sizeof (Request));\r
 \r
   Dev = VIRTIO_SCSI_FROM_PASS_THRU (This);\r
@@ -1223,6 +1232,7 @@ VirtioScsiExitBoot (
 {\r
   VSCSI_DEV *Dev;\r
 \r
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));\r
   //\r
   // Reset the device. This causes the hypervisor to forget about the virtio\r
   // ring.\r
@@ -1232,12 +1242,6 @@ VirtioScsiExitBoot (
   //\r
   Dev = Context;\r
   Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);\r
-\r
-  //\r
-  // Unmap the ring buffer so that hypervisor will not be able to get\r
-  // readable data after device reset.\r
-  //\r
-  Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, Dev->RingMap);\r
 }\r
 \r
 \r