From patchwork Thu Nov 13 11:16:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 40736 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 51810240ED for ; Thu, 13 Nov 2014 11:17:04 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id y19sf553913wgg.3 for ; Thu, 13 Nov 2014 03:17:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=OPhTXxrKcs8gUzhZ3LHxUDPyVP7FQExK/D0lhj1sc7Y=; b=UJLgOgelW+x4QO8SFUeTZwzptBsR6/VuWwi53gXJ60N7C0cTve+dgPc5pyr7rhpNS5 +ZhkA+c8eR7DQYe3scaRE8n35+E1Cpujb6O4wNItGeN4fIoMeGVPsw1czb4kvOBLpCyZ yx8Gxs4z2RjzL+WEloD0/mS0PuK5l15LnAgjVJFZYYOo6QNuJgqI/V027K7qc0yWshKR 09loR78/6yP03pLf4TuAu6iAByFnxIAn36HgmJuQea5Qv7yd6Y/VSK4zSEq70tR3Q7hv wceUhgbt6uef7Nh1QOUf47OGS8XdPf/KfZUX9amadWC+BCQAbRchyUoEgPWF/FPllK/b IU2w== X-Gm-Message-State: ALoCoQnDEP+UHFbCRCeHXKTXOqotiXiCQ/ZNPMMGzrwjPaKCvDa+gslBv6rGaHgQfJdBJfmViaS1 X-Received: by 10.112.32.163 with SMTP id k3mr291436lbi.17.1415877423309; Thu, 13 Nov 2014 03:17:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.68 with SMTP id da4ls651440lad.87.gmail; Thu, 13 Nov 2014 03:17:03 -0800 (PST) X-Received: by 10.112.132.104 with SMTP id ot8mr1778578lbb.3.1415877423064; Thu, 13 Nov 2014 03:17:03 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id k9si38104376lam.39.2014.11.13.03.17.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 03:17:03 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id ge10so12692226lab.8 for ; Thu, 13 Nov 2014 03:17:03 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr1770515lbr.74.1415877422982; Thu, 13 Nov 2014 03:17:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp572475lbc; Thu, 13 Nov 2014 03:17:02 -0800 (PST) X-Received: by 10.50.131.199 with SMTP id oo7mr973448igb.42.1415877421540; Thu, 13 Nov 2014 03:17:01 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id mi5si27276267igb.4.2014.11.13.03.17.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 13 Nov 2014 03:17:01 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XosOS-0005VH-En; Thu, 13 Nov 2014 11:16:52 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XosOR-0005V8-6A for edk2-devel@lists.sourceforge.net; Thu, 13 Nov 2014 11:16:51 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XosOQ-0005GN-BI for edk2-devel@lists.sourceforge.net; Thu, 13 Nov 2014 11:16:51 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sADBGiI2013003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 13 Nov 2014 06:16:44 -0500 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-83.ams2.redhat.com [10.36.116.83]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sADBGTn3018997 for ; Thu, 13 Nov 2014 06:16:43 -0500 From: Laszlo Ersek To: edk2-devel@lists.sourceforge.net Date: Thu, 13 Nov 2014 12:16:23 +0100 Message-Id: <1415877385-18341-6-git-send-email-lersek@redhat.com> In-Reply-To: <1415877385-18341-1-git-send-email-lersek@redhat.com> References: <1415877385-18341-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -2.5 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1XosOQ-0005GN-BI Subject: [edk2] [PATCH v2 5/7] OvmfPkg: VirtioScsiDxe: drop 64-bit shift in PopulateRequest() (VS2010) X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Scott Duplichan "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 [lersek@redhat.com: added commit message] Signed-off-by: Laszlo Ersek --- OvmfPkg/VirtioScsiDxe/VirtioScsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c index 6b8ea60..2cb3f43 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; //