summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2018-12-28 13:17:50 +0800
committerLiming Gao <liming.gao@intel.com>2019-01-08 09:59:30 +0800
commita53a888de8f5fa8dbf75a381e28f25a5497572f1 (patch)
treed9176a19ce6f417e093a3e660daae36c539c3932 /MdeModulePkg/Bus
parent9248a4717a9e269670be964b56bc1a1219cae2b2 (diff)
downloadedk2-a53a888de8f5fa8dbf75a381e28f25a5497572f1.zip
edk2-a53a888de8f5fa8dbf75a381e28f25a5497572f1.tar.gz
edk2-a53a888de8f5fa8dbf75a381e28f25a5497572f1.tar.bz2
MdeModulePkg/NonDiscoverablePciDevice: Remove the redundant check
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>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
index f0d3472..2be8b36 100644
--- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
+++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
@@ -1276,11 +1276,9 @@ PciIoAttributes (
Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This);
- if (Attributes) {
- if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
- return EFI_UNSUPPORTED;
- }
- }
+ if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
+ return EFI_UNSUPPORTED;
+ }
Enable = FALSE;
switch (Operation) {