diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2007-02-13 13:26:20 +0100 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 13:26:20 +0100 |
commit | 429d512e532ec9c969aa6f66ddbc542f3a5fe4da (patch) | |
tree | 0c3eb4dece9fa05fed66bbcfe906b0221cbbe4be /arch/i386/pci/mmconfig.c | |
parent | a4ec1b2c9fe9492c9ab30261b411d836527fe0b6 (diff) | |
download | linux-429d512e532ec9c969aa6f66ddbc542f3a5fe4da.tar.bz2 |
[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.c | 13 |
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; */ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) { - int cfg_num = -1; struct acpi_mcfg_allocation *cfg; + int cfg_num; if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS && test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots)) return 0; - while (1) { - ++cfg_num; - if (cfg_num >= pci_mmcfg_config_num) { - break; - } + for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) { cfg = &pci_mmcfg_config[cfg_num]; - if (cfg->pci_segment != seg) - continue; - if ((cfg->start_bus_number <= bus) && + if (cfg->pci_segment == seg && + (cfg->start_bus_number <= bus) && (cfg->end_bus_number >= bus)) return cfg->address; } |