]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioScsiDxe/VirtioScsi.c
OvmfPkg/XenPvBlkDxe: Don't include system inttypes.h
[mirror_edk2.git] / OvmfPkg / VirtioScsiDxe / VirtioScsi.c
index 2223c9c33e8ec774bb7ac22d0ee60571afc29dd4..6b8ea601cd7f786c2741eb6e74f8a35cc5067e3b 100644 (file)
@@ -26,7 +26,7 @@
     unreasonable for now.\r
 \r
   Copyright (C) 2012, Red Hat, Inc.\r
-  Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
                        one of UINT8, UINT16, UINT32, UINT64.\r
 \r
 \r
-  @return  Status codes returned by VirtioWriteDevice() / VirtioReadDevice().\r
+  @return  Status codes returned by Virtio->WriteDevice() / Virtio->ReadDevice().\r
 \r
 **/\r
 \r
-#define VIRTIO_CFG_WRITE(Dev, Field, Value)  (VirtioWriteDevice (        \\r
-                                                (Dev)->VirtIo,           \\r
-                                                OFFSET_OF_VSCSI (Field), \\r
-                                                SIZE_OF_VSCSI (Field),   \\r
-                                                (Value)                  \\r
+#define VIRTIO_CFG_WRITE(Dev, Field, Value)  ((Dev)->VirtIo->WriteDevice (  \\r
+                                                (Dev)->VirtIo,              \\r
+                                                OFFSET_OF_VSCSI (Field),    \\r
+                                                SIZE_OF_VSCSI (Field),      \\r
+                                                (Value)                     \\r
                                                 ))\r
 \r
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice (         \\r
-                                                (Dev)->VirtIo,           \\r
-                                                OFFSET_OF_VSCSI (Field), \\r
-                                                SIZE_OF_VSCSI (Field),   \\r
-                                                sizeof *(Pointer),       \\r
-                                                (Pointer)                \\r
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice (   \\r
+                                                (Dev)->VirtIo,              \\r
+                                                OFFSET_OF_VSCSI (Field),    \\r
+                                                SIZE_OF_VSCSI (Field),      \\r
+                                                sizeof *(Pointer),          \\r
+                                                (Pointer)                   \\r
                                                 ))\r
 \r
 \r
@@ -748,7 +748,7 @@ VirtioScsiInit (
   if (EFI_ERROR (Status)) {\r
     goto Failed;\r
   }\r
-  Dev->InOutSupported = !!(Features & VIRTIO_SCSI_F_INOUT);\r
+  Dev->InOutSupported = (BOOLEAN) ((Features & VIRTIO_SCSI_F_INOUT) != 0);\r
 \r
   Status = VIRTIO_CFG_READ (Dev, MaxChannel, &MaxChannel);\r
   if (EFI_ERROR (Status)) {\r
@@ -842,7 +842,7 @@ VirtioScsiInit (
   // step 4c -- Report GPFN (guest-physical frame number) of queue.\r
   //\r
   Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,\r
-      (UINT32)(UINTN) Dev->Ring.Base >> EFI_PAGE_SHIFT);\r
+      (UINT32) ((UINTN) Dev->Ring.Base >> EFI_PAGE_SHIFT));\r
   if (EFI_ERROR (Status)) {\r
     goto ReleaseQueue;\r
   }\r