summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
index e7d4ae3e55..3fa985f567 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
@@ -451,7 +451,7 @@ PciIoMemRead (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}
@@ -526,7 +526,7 @@ PciIoMemWrite (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}
@@ -600,7 +600,7 @@ PciIoIoRead (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}
@@ -674,7 +674,7 @@ PciIoIoWrite (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}
@@ -739,7 +739,7 @@ PciIoConfigRead (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}
@@ -804,7 +804,7 @@ PciIoConfigWrite (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}
@@ -899,7 +899,7 @@ PciIoCopyMem (
//
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
if ((SrcOffset & ((1 << (Width & 0x03)) - 1)) != 0 || (DestOffset & ((1 << (Width & 0x03)) - 1)) != 0) {
- Width &= (~0x03);
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
Count *= (UINTN)(1 << (Width & 0x03));
}
}