* [PATCH v2 1/1] OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure
@ 2017-07-11 18:38 Brijesh Singh
2017-07-11 22:20 ` Laszlo Ersek
0 siblings, 1 reply; 2+ messages in thread
From: Brijesh Singh @ 2017-07-11 18:38 UTC (permalink / raw)
To: edk2-devel; +Cc: Brijesh Singh, Jordan Justen, Laszlo Ersek
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: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
Changes since v1:
- add comments and move the local variable initialization to new line
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 dbebd36b1853..0310d2872dae 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 warnigns
+ //
+ NumPages = 0;
+
+ //
// When SEV is enabled then allocate DMA bounce buffer
//
if (InternalQemuFwCfgSevIsEnabled ()) {
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/1] OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure
2017-07-11 18:38 [PATCH v2 1/1] OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure Brijesh Singh
@ 2017-07-11 22:20 ` Laszlo Ersek
0 siblings, 0 replies; 2+ messages in thread
From: Laszlo Ersek @ 2017-07-11 22:20 UTC (permalink / raw)
To: Brijesh Singh, edk2-devel; +Cc: Jordan Justen
On 07/11/17 20:38, Brijesh Singh wrote:
> 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: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> ---
> Changes since v1:
> - add comments and move the local variable initialization to new line
>
> 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 dbebd36b1853..0310d2872dae 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 warnigns
> + //
> + NumPages = 0;
> +
> + //
> // When SEV is enabled then allocate DMA bounce buffer
> //
> if (InternalQemuFwCfgSevIsEnabled ()) {
>
Reported-by: Gerd Hoffmann <kraxel@redhat.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>
Pushed as commit e508e069a809.
I also fixed up the typo in
<https://bugzilla.tianocore.org/show_bug.cgi?id=607#c3>.
Thanks!
Laszlo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-11 22:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11 18:38 [PATCH v2 1/1] OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure Brijesh Singh
2017-07-11 22:20 ` Laszlo Ersek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox