Revision: 16386
          http://sourceforge.net/p/edk2/code/16386
Author:   lersek
Date:     2014-11-14 10:24:08 +0000 (Fri, 14 Nov 2014)
Log Message:
-----------
OvmfPkg: VirtioScsiDxe: drop 64-bit shift in PopulateRequest() (VS2010)

"Lun" has type UINT64 in this function. The result of the expression

  (UINT8) ((Lun >> 8) | 0x40)

depends only on bits [15:8] of "Lun", therefore we can cast "Lun" to
UINT32 before shifting it.

This eliminates an intrinsic when building with VS2010 for Ia32 / NOOPT.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Scott Duplichan <[email protected]>

[[email protected]: added commit message]

Signed-off-by: Laszlo Ersek <[email protected]>

Build-tested-by: Scott Duplichan <[email protected]>

Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    trunk/edk2/OvmfPkg/VirtioScsiDxe/VirtioScsi.c

Modified: trunk/edk2/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
===================================================================
--- trunk/edk2/OvmfPkg/VirtioScsiDxe/VirtioScsi.c       2014-11-14 10:23:55 UTC 
(rev 16385)
+++ trunk/edk2/OvmfPkg/VirtioScsiDxe/VirtioScsi.c       2014-11-14 10:24:08 UTC 
(rev 16386)
@@ -253,7 +253,7 @@
   //
   Request->Lun[0] = 1;
   Request->Lun[1] = (UINT8) Target;
-  Request->Lun[2] = (UINT8) ((Lun >> 8) | 0x40);
+  Request->Lun[2] = (UINT8) (((UINT32)Lun >> 8) | 0x40);
   Request->Lun[3] = (UINT8) Lun;
 
   //


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to