From e90f51a822c319b0e36bf55e260684239da325b4 Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Wed, 24 Feb 2016 16:02:18 +0800 Subject: MdeModulePkg/PciBus: reorganize case-statement to reduce code lines Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Feng Tian Reviewed-by: Laszlo Ersek --- MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c index 020048d4ad..334a6ac309 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c @@ -1819,53 +1819,39 @@ PciIoGetBarAttributes ( Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_IO; break; - case PciBarTypeMem32: + case PciBarTypePMem32: // - // Mem + // prefechable // - Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM; + Descriptor->SpecificFlag = EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE; // - // 32 bit + // Fall through // - Descriptor->AddrSpaceGranularity = 32; - break; - - case PciBarTypePMem32: + case PciBarTypeMem32: // // Mem // Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM; // - // prefechable - // - Descriptor->SpecificFlag = 0x6; - // // 32 bit // Descriptor->AddrSpaceGranularity = 32; break; - case PciBarTypeMem64: + case PciBarTypePMem64: // - // Mem + // prefechable // - Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM; + Descriptor->SpecificFlag = EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE; // - // 64 bit + // Fall through // - Descriptor->AddrSpaceGranularity = 64; - break; - - case PciBarTypePMem64: + case PciBarTypeMem64: // // Mem // Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM; // - // prefechable - // - Descriptor->SpecificFlag = 0x6; - // // 64 bit // Descriptor->AddrSpaceGranularity = 64; -- cgit v1.2.3