[edk2] [patch] MdeModulePkg/NonDiscoverable: Use compare operator for comparison

Dandan Bi dandan.bi at intel.com
Fri Dec 28 00:54:29 PST 2018


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 at intel.com>
Cc: Hao Wu <hao.a.wu at intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi at 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



More information about the edk2-devel mailing list