Commit 2f2a8b9c authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

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: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 56ddf4d3
...@@ -438,9 +438,10 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used) ...@@ -438,9 +438,10 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used)
typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type); typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type);
static int __init is_mmconf_reserved(check_reserved_t is_reserved, static int __init is_mmconf_reserved(check_reserved_t is_reserved,
u64 addr, u64 size, int i, int i, typeof(pci_mmcfg_config[0]) *cfg, int with_e820)
typeof(pci_mmcfg_config[0]) *cfg, int with_e820)
{ {
u64 addr = cfg->res.start;
u64 size = resource_size(&cfg->res);
u64 old_size = size; u64 old_size = size;
int valid = 0, num_buses; int valid = 0, num_buses;
...@@ -486,11 +487,8 @@ static void __init pci_mmcfg_reject_broken(int early) ...@@ -486,11 +487,8 @@ static void __init pci_mmcfg_reject_broken(int early)
for (i = 0; i < pci_mmcfg_config_num; i++) { for (i = 0; i < pci_mmcfg_config_num; i++) {
int valid = 0; int valid = 0;
u64 addr, size;
cfg = &pci_mmcfg_config[i]; cfg = &pci_mmcfg_config[i];
addr = cfg->res.start;
size = resource_size(&cfg->res);
printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx " printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx "
"segment %hu buses %u - %u\n", "segment %hu buses %u - %u\n",
i, (unsigned long)cfg->address, cfg->segment, i, (unsigned long)cfg->address, cfg->segment,
...@@ -498,7 +496,7 @@ static void __init pci_mmcfg_reject_broken(int early) ...@@ -498,7 +496,7 @@ static void __init pci_mmcfg_reject_broken(int early)
(unsigned int)cfg->end_bus); (unsigned int)cfg->end_bus);
if (!early && !acpi_disabled) if (!early && !acpi_disabled)
valid = is_mmconf_reserved(is_acpi_reserved, addr, size, i, cfg, 0); valid = is_mmconf_reserved(is_acpi_reserved, i, cfg, 0);
if (valid) if (valid)
continue; continue;
...@@ -511,7 +509,7 @@ static void __init pci_mmcfg_reject_broken(int early) ...@@ -511,7 +509,7 @@ static void __init pci_mmcfg_reject_broken(int early)
/* Don't try to do this check unless configuration /* Don't try to do this check unless configuration
type 1 is available. how about type 2 ?*/ type 1 is available. how about type 2 ?*/
if (raw_pci_ops) if (raw_pci_ops)
valid = is_mmconf_reserved(e820_all_mapped, addr, size, i, cfg, 1); valid = is_mmconf_reserved(e820_all_mapped, i, cfg, 1);
if (!valid) if (!valid)
goto reject; goto reject;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment