From: Brijesh Singh <brijesh.singh@amd.com>
To: Laszlo Ersek <lersek@redhat.com>, edk2-devel@lists.01.org
Cc: brijesh.singh@amd.com, Jordan Justen <jordan.l.justen@intel.com>
Subject: Re: [PATCH 1/1] OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure
Date: Tue, 11 Jul 2017 13:13:48 -0500 [thread overview]
Message-ID: <f413de4f-e896-a87c-b507-b4a442e4e4fe@amd.com> (raw)
In-Reply-To: <3b31ba2f-04ba-1aa1-5baf-d2a13d3570b8@redhat.com>
On 07/11/2017 12:34 PM, Laszlo Ersek wrote:
> Hi Brijesh,
>
> On 07/11/17 19:08, 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>
>> ---
>> OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>> index dbebd36b1853..1b21ef094dc5 100644
>> --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>> @@ -72,7 +72,7 @@ InternalQemuFwCfgDmaBytes (
>> volatile FW_CFG_DMA_ACCESS *Access;
>> UINT32 AccessHigh, AccessLow;
>> UINT32 Status;
>> - UINT32 NumPages;
>> + UINT32 NumPages = 0;
>> VOID *DmaBuffer, *BounceBuffer;
>>
>> ASSERT (Control == FW_CFG_DMA_CTL_WRITE || Control == FW_CFG_DMA_CTL_READ ||
>>
>
> In edk2 we don't initialize local variables in the ISO C sense of
> "initialization" -- please use a separate assignment, plus add a code
> comment like mentioned here:
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=607
>
Thanks for quick review Laszlo, I will update the patch with those comments.
-Brijesh
prev parent reply other threads:[~2017-07-11 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 17:08 [PATCH 1/1] OvmfPkg/QemuFwCfgLib: Suppress GCC49 IA32 build failure Brijesh Singh
2017-07-11 17:34 ` Laszlo Ersek
2017-07-11 18:13 ` Brijesh Singh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f413de4f-e896-a87c-b507-b4a442e4e4fe@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox