]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/NonDiscoverablePciDevice: Remove the redundant check
authorDandan Bi <dandan.bi@intel.com>
Fri, 28 Dec 2018 05:17:50 +0000 (13:17 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 8 Jan 2019 01:59:30 +0000 (09:59 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1422

if (Attributes) {
  if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
    return EFI_UNSUPPORTED;
  }
}
In above code block,
"If ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0)" is TRUE,
the Attributes must be not 0. So we can remove the redundant
check "if (Attributes)".

Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c

index f0d3472ea57bb0f7f6cf98914d4ec4215a77df1c..2be8b36acc405d17354ab504aa2c20d6d88843c1 100644 (file)
@@ -1276,11 +1276,9 @@ PciIoAttributes (
 \r
   Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This);\r
 \r
-  if (Attributes) {\r
-      if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
-    }\r
+  if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
 \r
   Enable = FALSE;\r
   switch (Operation) {\r