]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioScsiDxe/VirtioScsi.c
OvmfPkg: VirtioScsiDxe: drop 64-bit shift in PopulateRequest() (VS2010)
[mirror_edk2.git] / OvmfPkg / VirtioScsiDxe / VirtioScsi.c
index 0bcceecab113ae38b31eeadd50ef7c0071c3843f..2cb3f43bb01c25c29297f0e7027d11dcd5391b8d 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
@@ -253,7 +253,7 @@ PopulateRequest (
   //\r
   Request->Lun[0] = 1;\r
   Request->Lun[1] = (UINT8) Target;\r
-  Request->Lun[2] = (UINT8) ((Lun >> 8) | 0x40);\r
+  Request->Lun[2] = (UINT8) (((UINT32)Lun >> 8) | 0x40);\r
   Request->Lun[3] = (UINT8) Lun;\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