aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/pci/mmconfig.c
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2007-02-13 07:26:20 -0500
committerAndi Kleen <andi@basil.nowhere.org>2007-02-13 07:26:20 -0500
commit429d512e532ec9c969aa6f66ddbc542f3a5fe4da (patch)
tree0c3eb4dece9fa05fed66bbcfe906b0221cbbe4be /arch/i386/pci/mmconfig.c
parenta4ec1b2c9fe9492c9ab30261b411d836527fe0b6 (diff)
[PATCH] mmconfig: minor cleanup in mmconfig code
This just cleans up. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/pci/mmconfig.c')
-rw-r--r--arch/i386/pci/mmconfig.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 3325b79e651c..11be089efd7d 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -27,22 +27,17 @@ static int mmcfg_last_accessed_cpu;
27 */ 27 */
28static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) 28static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
29{ 29{
30 int cfg_num = -1;
31 struct acpi_mcfg_allocation *cfg; 30 struct acpi_mcfg_allocation *cfg;
31 int cfg_num;
32 32
33 if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS && 33 if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
34 test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots)) 34 test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots))
35 return 0; 35 return 0;
36 36
37 while (1) { 37 for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
38 ++cfg_num;
39 if (cfg_num >= pci_mmcfg_config_num) {
40 break;
41 }
42 cfg = &pci_mmcfg_config[cfg_num]; 38 cfg = &pci_mmcfg_config[cfg_num];
43 if (cfg->pci_segment != seg) 39 if (cfg->pci_segment == seg &&
44 continue; 40 (cfg->start_bus_number <= bus) &&
45 if ((cfg->start_bus_number <= bus) &&
46 (cfg->end_bus_number >= bus)) 41 (cfg->end_bus_number >= bus))
47 return cfg->address; 42 return cfg->address;
48 } 43 }