summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2017-07-11 14:38:13 -0400
committerLaszlo Ersek <lersek@redhat.com>2017-07-12 00:16:41 +0200
commite508e069a809ba895230ef6ea5c8d43c471d0de4 (patch)
tree1793f560183c41503fa27e2a304f15b27a190f30 /OvmfPkg
parented6da357a30666cfccfd2539d88e6171710084b7 (diff)
downloadedk2-e508e069a809ba895230ef6ea5c8d43c471d0de4.tar.gz
edk2-e508e069a809ba895230ef6ea5c8d43c471d0de4.tar.bz2
edk2-e508e069a809ba895230ef6ea5c8d43c471d0de4.zip
OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure
NumPages variable was introduced in commit 66c548be509d. In this commit we allocate an intermediate buffer when SEV is enabled. The 'BounceBuffer' variable points to the intermediate buffer pointer and NumPages variables stores the number of pages. Later in the code, 'BounceBuffer' variable is checked to see if we need to free the intermediate buffers. The code looks correct, suppress the warning. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Reported-by: Gerd Hoffmann <kraxel@redhat.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: s/warnigns/warnings/ in the code comment] [lersek@redhat.com: add Gerd's Reported-by] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index dbebd36b18..d3bf75498d 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
@@ -83,6 +83,11 @@ InternalQemuFwCfgDmaBytes (
}
//
+ // set NumPages to suppress incorrect compiler/analyzer warnings
+ //
+ NumPages = 0;
+
+ //
// When SEV is enabled then allocate DMA bounce buffer
//
if (InternalQemuFwCfgSevIsEnabled ()) {