summaryrefslogtreecommitdiff
path: root/OvmfPkg
diff options
context:
space:
mode:
authorScott Duplichan <scott@notabs.org>2014-11-14 10:24:08 +0000
committerlersek <lersek@Edk2>2014-11-14 10:24:08 +0000
commitfaba4a14de81d4f20aa07336e7433835edd760f8 (patch)
treec384d3d45b2dab1f2a7e0d848676ddbf8f188970 /OvmfPkg
parent75f8e3aaff4d77ec2a04c14633d63b67c651edda (diff)
downloadedk2-platforms-faba4a14de81d4f20aa07336e7433835edd760f8.tar.xz
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 <scott@notabs.org> [lersek@redhat.com: added commit message] Signed-off-by: Laszlo Ersek <lersek@redhat.com> Build-tested-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16386 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/VirtioScsiDxe/VirtioScsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
index 6b8ea601cd..2cb3f43bb0 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
@@ -253,7 +253,7 @@ PopulateRequest (
//
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;
//