public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>
Subject: [patch] MdeModulePkg/NonDiscoverable: Use compare operator for comparison
Date: Fri, 28 Dec 2018 16:54:29 +0800	[thread overview]
Message-ID: <20181228085429.47056-2-dandan.bi@intel.com> (raw)
In-Reply-To: <20181228085429.47056-1-dandan.bi@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1422

According to EDK II C Coding Standards Specification,
Non-Boolean comparisons must use a compare operator.
This patch is to update the code to follow EDKII coding style.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 .../NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
index f0d3472ea5..a0fe3b9ffa 100644
--- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
+++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
@@ -1274,11 +1274,11 @@ PciIoAttributes (
   #define DEV_SUPPORTED_ATTRIBUTES \
     (EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE)
 
   Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This);
 
-  if (Attributes) {
+  if (Attributes != 0) {
       if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
         return EFI_UNSUPPORTED;
       }
     }
 
-- 
2.18.0.windows.1



  reply	other threads:[~2018-12-28  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28  8:54 [patch] BaseTools/VfrCompile: report error for Integer overflow Dandan Bi
2018-12-28  8:54 ` Dandan Bi [this message]
2018-12-29  0:43   ` [patch] MdeModulePkg/NonDiscoverable: Use compare operator for comparison Wang, Jian J
2019-01-01 13:17   ` Zeng, Star
2019-01-02  1:42     ` Bi, Dandan
2019-01-07 14:30 ` [patch] BaseTools/VfrCompile: report error for Integer overflow Gao, Liming

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=20181228085429.47056-2-dandan.bi@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