summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--OvmfPkg/VirtioScsiDxe/VirtioScsi.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
index 66f6d31d74..e58dd80df2 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
@@ -413,19 +413,8 @@ VirtioScsiPassThru (
volatile VIRTIO_SCSI_RESP Response;
DESC_INDICES Indices;
- //
- // Zero-initialization of Request & Response with "= { 0 };" doesn't build
- // with gcc-4.4: "undefined reference to `memset'". Direct SetMem() is not
- // allowed as it would cast away the volatile qualifier. Work it around.
- //
- union {
- VIRTIO_SCSI_REQ Request;
- VIRTIO_SCSI_RESP Response;
- } Zero;
-
- SetMem (&Zero, sizeof Zero, 0x00);
- Request = Zero.Request;
- Response = Zero.Response;
+ ZeroMem ((VOID*) &Request, sizeof (Request));
+ ZeroMem ((VOID*) &Response, sizeof (Response));
Dev = VIRTIO_SCSI_FROM_PASS_THRU (This);
CopyMem (&TargetValue, Target, sizeof TargetValue);