From patchwork Sat Nov 14 00:34:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 59984 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAE0YeO8004199 for ; Sat, 14 Nov 2009 00:34:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932313AbZKNAe3 (ORCPT ); Fri, 13 Nov 2009 19:34:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932601AbZKNAe3 (ORCPT ); Fri, 13 Nov 2009 19:34:29 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:18487 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932313AbZKNAe2 (ORCPT ); Fri, 13 Nov 2009 19:34:28 -0500 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0016.houston.hp.com (Postfix) with ESMTP id 92E7C141E1; Sat, 14 Nov 2009 00:34:34 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0009.houston.hp.com (Postfix) with ESMTP id 811EEC022; Sat, 14 Nov 2009 00:34:34 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 53790CF0012; Fri, 13 Nov 2009 17:34:34 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yHw+4Pgd+ix5; Fri, 13 Nov 2009 17:34:34 -0700 (MST) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 3DE82CF0008; Fri, 13 Nov 2009 17:34:34 -0700 (MST) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 32D5426172; Fri, 13 Nov 2009 17:34:34 -0700 (MST) Subject: [PATCH v2 12/18] x86/PCI: MMCONFIG: trivial is_mmconf_reserved() interface simplification To: Jesse Barnes From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, x86@kernel.org, Yinghai Lu Date: Fri, 13 Nov 2009 17:34:34 -0700 Message-ID: <20091114003434.30492.43557.stgit@bob.kio> In-Reply-To: <20091114003135.30492.75626.stgit@bob.kio> References: <20091114003135.30492.75626.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index ba3aa36..90422b4 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) typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type); static int __init is_mmconf_reserved(check_reserved_t is_reserved, - u64 addr, u64 size, int i, - typeof(pci_mmcfg_config[0]) *cfg, int with_e820) + int i, typeof(pci_mmcfg_config[0]) *cfg, int with_e820) { + u64 addr = cfg->res.start; + u64 size = resource_size(&cfg->res); u64 old_size = size; int valid = 0, num_buses; @@ -486,11 +487,8 @@ static void __init pci_mmcfg_reject_broken(int early) for (i = 0; i < pci_mmcfg_config_num; i++) { int valid = 0; - u64 addr, size; cfg = &pci_mmcfg_config[i]; - addr = cfg->res.start; - size = resource_size(&cfg->res); printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx " "segment %hu buses %u - %u\n", i, (unsigned long)cfg->address, cfg->segment, @@ -498,7 +496,7 @@ static void __init pci_mmcfg_reject_broken(int early) (unsigned int)cfg->end_bus); 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) continue; @@ -511,7 +509,7 @@ static void __init pci_mmcfg_reject_broken(int early) /* Don't try to do this check unless configuration type 1 is available. how about type 2 ?*/ 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) goto reject;