From e508e069a809ba895230ef6ea5c8d43c471d0de4 Mon Sep 17 00:00:00 2001 From: Brijesh Singh Date: Tue, 11 Jul 2017 14:38:13 -0400 Subject: [PATCH] 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 Cc: Laszlo Ersek Reported-by: Gerd Hoffmann Reported-by: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Reviewed-by: Laszlo Ersek [lersek@redhat.com: s/warnigns/warnings/ in the code comment] [lersek@redhat.com: add Gerd's Reported-by] Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 5 +++++ 1 file changed, 5 insertions(+) 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 @@ -82,6 +82,11 @@ InternalQemuFwCfgDmaBytes ( return; } + // + // set NumPages to suppress incorrect compiler/analyzer warnings + // + NumPages = 0; + // // When SEV is enabled then allocate DMA bounce buffer //