summaryrefslogtreecommitdiff
path: root/OvmfPkg/VirtioNetDxe/SnpReceive.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2013-06-14 07:40:59 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2013-06-14 07:40:59 +0000
commit9f3acbb5c9e10f1bdbf5c4b26c0f7d3739d94543 (patch)
treea2edcf7eabce3fa307aa1b7bb23c26d7dc613feb /OvmfPkg/VirtioNetDxe/SnpReceive.c
parent65575e4f1378bb5899e8c9218e2957fa5f6f0cc1 (diff)
downloadedk2-platforms-9f3acbb5c9e10f1bdbf5c4b26c0f7d3739d94543.tar.xz
OvmfPkg: VirtioNetDxe: fix some build errors emitted by Visual Studio
These were found with the gcc-4.4 option "-Wconversion" after Jordan reported the build failure under Visual Studio. The patch was originally posted to edk2-devel as "silence.patch": http://thread.gmane.org/gmane.comp.bios.tianocore.devel/2804/focus=2972 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14419 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/VirtioNetDxe/SnpReceive.c')
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpReceive.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/OvmfPkg/VirtioNetDxe/SnpReceive.c b/OvmfPkg/VirtioNetDxe/SnpReceive.c
index eb3a2ba9b5..dcff6a09fc 100644
--- a/OvmfPkg/VirtioNetDxe/SnpReceive.c
+++ b/OvmfPkg/VirtioNetDxe/SnpReceive.c
@@ -156,7 +156,7 @@ VirtioNetReceive (
RxPtr += SIZE_OF_VNET (VhdrMac);
if (Protocol != NULL) {
- *Protocol = ((UINT16) RxPtr[0] << 8) | RxPtr[1];
+ *Protocol = (UINT16) ((RxPtr[0] << 8) | RxPtr[1]);
}
RxPtr += sizeof (UINT16);
@@ -169,7 +169,8 @@ RecycleDesc:
// virtio-0.9.5, 2.4.1 Supplying Buffers to The Device
//
AvailIdx = *Dev->RxRing.Avail.Idx;
- Dev->RxRing.Avail.Ring[AvailIdx++ % Dev->RxRing.QueueSize] = DescIdx;
+ Dev->RxRing.Avail.Ring[AvailIdx++ % Dev->RxRing.QueueSize] =
+ (UINT16) DescIdx;
MemoryFence ();
*Dev->RxRing.Avail.Idx = AvailIdx;