From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [patch] PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure
Date: Wed, 22 Nov 2017 02:40:58 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BACB16A@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1511316140-12868-1-git-send-email-dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> -----Original Message-----
> From: Bi, Dandan
> Sent: Wednesday, November 22, 2017 10:02 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [patch] PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure
>
> Done:
> if (EFI_ERROR (Status)) {
> if (PciIo != NULL && Enabled) {
> PciIo->Attributes (
> PciIo,
> EfiPciIoAttributeOperationSet,
> OriginalAttributes,
> NULL
> );
> }
> }
> In above codes, VS2012/VS2010 will report that "OriginalAttributes"
> will be used without initialization. But in fact, when the if expression is true(if
> (PciIo != NULL && Enabled)), the "OriginalAttributes" must be initialized. In order
> to fix this false positive issue, we initialize the "OriginalAttributes" after
> declaration.
>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
> PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
> b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
> index d82e2c4..c7ea559 100644
> --- a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
> +++ b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
> @@ -176,10 +176,11 @@ PcatIsaAcpiDriverBindingStart (
> BOOLEAN Enabled;
>
> Enabled = FALSE;
> Supports = 0;
> PcatIsaAcpiDev = NULL;
> + OriginalAttributes = 0;
> //
> // Open the PCI I/O Protocol Interface
> //
> PciIo = NULL;
> Status = gBS->OpenProtocol (
> --
> 1.9.5.msysgit.1
prev parent reply other threads:[~2017-11-22 2:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 2:02 [patch] PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure Dandan Bi
2017-11-22 2:40 ` Ni, Ruiyu [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=734D49CCEBEEF84792F5B80ED585239D5BACB16A@SHSMSX104.ccr.corp.intel.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