if (Attributes) {
if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
return EFI_UNSUPPORTED;
}
}
If ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) is TRUE, the Attributes
must be not 0.
So " if (Attributes " could be removed.
BTW: This code block has indentation problem.
With them handled, Reviewed-by: Star Zeng <[email protected]>
Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Dandan Bi
Sent: Friday, December 28, 2018 4:54 PM
To: [email protected]
Cc: Wu, Hao A <[email protected]>
Subject: [edk2] [patch] MdeModulePkg/NonDiscoverable: Use compare operator for
comparison
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 <[email protected]>
Cc: Hao Wu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
---
.../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/NonDiscoverablePc
+++ iDeviceIo.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
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel