summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2015-07-29 11:11:56 +0000
committererictian <erictian@Edk2>2015-07-29 11:11:56 +0000
commitb56750422f7df2f2ecbbed4c75976c1d5abc88ae (patch)
tree4589d9da7b011cd0709e5cd7dd27ee29eeb0d26d /MdeModulePkg
parent26c2edd51fdfccafb2711760432086a6115a7748 (diff)
downloadedk2-platforms-b56750422f7df2f2ecbbed4c75976c1d5abc88ae.tar.xz
MdeModulePkg/PciBus: Simplify an complex if statement to pass VS2015
The logic in an if statement in PciIo is too complex and hard to understand and make VS2015 build failure. The fix simplifies the logic. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18109 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
index 15d6443fd3..416063268f 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
@@ -1,7 +1,7 @@
/** @file
EFI PCI IO protocol functions implementation for PCI Bus module.
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1568,15 +1568,10 @@ PciIoAttributes (
//
// Check VGA and VGA16, they can not be set at the same time
//
- if (((Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_IO) != 0 &&
- (Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_IO_16) != 0) ||
- ((Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_IO) != 0 &&
- (Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16) != 0) ||
- ((Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO) != 0 &&
- (Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_IO_16) != 0) ||
- ((Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO) != 0 &&
- (Attributes & EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16) != 0) ) {
- return EFI_UNSUPPORTED;
+ if ((Attributes & (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO)) != 0) {
+ if ((Attributes & (EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 | EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16)) != 0) {
+ return EFI_UNSUPPORTED;
+ }
}
//