Skip to content

Commit

Permalink
x86/PCI: MMCONFIG: remove typeof so we can use a list
Browse files Browse the repository at this point in the history
This replaces "typeof(pci_mmcfg_config[0])" with the actual type because
I plan to convert pci_mmcfg_config to a list, and then "pci_mmcfg_config[0]"
won't mean anything.

Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Nov 24, 2009
1 parent 3f0f550 commit 987c367
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/x86/pci/mmconfig-shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ static struct pci_mmcfg_hostbridge_probe pci_mmcfg_probes[] __initdata = {

static int __init cmp_mmcfg(const void *x1, const void *x2)
{
const typeof(pci_mmcfg_config[0]) *m1 = x1;
const typeof(pci_mmcfg_config[0]) *m2 = x2;
const struct pci_mmcfg_region *m1 = x1;
const struct pci_mmcfg_region *m2 = x2;
int start1, start2;

start1 = m1->start_bus;
Expand All @@ -290,7 +290,7 @@ static int __init cmp_mmcfg(const void *x1, const void *x2)
static void __init pci_mmcfg_check_end_bus_number(void)
{
int i;
typeof(pci_mmcfg_config[0]) *cfg, *cfgx;
struct pci_mmcfg_region *cfg, *cfgx;

/* sort them at first */
sort(pci_mmcfg_config, pci_mmcfg_config_num,
Expand Down Expand Up @@ -438,7 +438,7 @@ 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,
int i, typeof(pci_mmcfg_config[0]) *cfg, int with_e820)
int i, struct pci_mmcfg_region *cfg, int with_e820)
{
u64 addr = cfg->res.start;
u64 size = resource_size(&cfg->res);
Expand Down Expand Up @@ -479,7 +479,7 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,

static void __init pci_mmcfg_reject_broken(int early)
{
typeof(pci_mmcfg_config[0]) *cfg;
struct pci_mmcfg_region *cfg;
int i;

if (pci_mmcfg_config_num == 0)
Expand Down

0 comments on commit 987c367

Please sign in to comment.