aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-11-13 19:34:34 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-24 18:29:49 -0500
commit2f2a8b9c90279e75f87aaf322a948bdced27e89f (patch)
treec984189a7dcba6050110a9ac5743912e504d450c /arch/x86/pci
parent56ddf4d3cf04e80254d3d721c6bea2f8ec44c41a (diff)
x86/PCI: MMCONFIG: trivial is_mmconf_reserved() interface simplification
Since pci_mmcfg_region contains the struct resource, no need to pass the pci_mmcfg_region *and* the resource start/size. Reviewed-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r--arch/x86/pci/mmconfig-shared.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index ba3aa3697418..90422b4a7c91 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -438,9 +438,10 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used)
438typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type); 438typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type);
439 439
440static int __init is_mmconf_reserved(check_reserved_t is_reserved, 440static int __init is_mmconf_reserved(check_reserved_t is_reserved,
441 u64 addr, u64 size, int i, 441 int i, typeof(pci_mmcfg_config[0]) *cfg, int with_e820)
442 typeof(pci_mmcfg_config[0]) *cfg, int with_e820)
443{ 442{
443 u64 addr = cfg->res.start;
444 u64 size = resource_size(&cfg->res);
444 u64 old_size = size; 445 u64 old_size = size;
445 int valid = 0, num_buses; 446 int valid = 0, num_buses;
446 447
@@ -486,11 +487,8 @@ static void __init pci_mmcfg_reject_broken(int early)
486 487
487 for (i = 0; i < pci_mmcfg_config_num; i++) { 488 for (i = 0; i < pci_mmcfg_config_num; i++) {
488 int valid = 0; 489 int valid = 0;
489 u64 addr, size;
490 490
491 cfg = &pci_mmcfg_config[i]; 491 cfg = &pci_mmcfg_config[i];
492 addr = cfg->res.start;
493 size = resource_size(&cfg->res);
494 printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx " 492 printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx "
495 "segment %hu buses %u - %u\n", 493 "segment %hu buses %u - %u\n",
496 i, (unsigned long)cfg->address, cfg->segment, 494 i, (unsigned long)cfg->address, cfg->segment,
@@ -498,7 +496,7 @@ static void __init pci_mmcfg_reject_broken(int early)
498 (unsigned int)cfg->end_bus); 496 (unsigned int)cfg->end_bus);
499 497
500 if (!early && !acpi_disabled) 498 if (!early && !acpi_disabled)
501 valid = is_mmconf_reserved(is_acpi_reserved, addr, size, i, cfg, 0); 499 valid = is_mmconf_reserved(is_acpi_reserved, i, cfg, 0);
502 500
503 if (valid) 501 if (valid)
504 continue; 502 continue;
@@ -511,7 +509,7 @@ static void __init pci_mmcfg_reject_broken(int early)
511 /* Don't try to do this check unless configuration 509 /* Don't try to do this check unless configuration
512 type 1 is available. how about type 2 ?*/ 510 type 1 is available. how about type 2 ?*/
513 if (raw_pci_ops) 511 if (raw_pci_ops)
514 valid = is_mmconf_reserved(e820_all_mapped, addr, size, i, cfg, 1); 512 valid = is_mmconf_reserved(e820_all_mapped, i, cfg, 1);
515 513
516 if (!valid) 514 if (!valid)
517 goto reject; 515 goto reject;