Skip to content

Commit 9ad6791

Browse files
committed
x86/pci: Rename acpi_mcfg_check_entry() to acpi_mcfg_valid_entry()
"acpi_mcfg_check_entry()" doesn't give a hint about what the return value means. Rename it to "acpi_mcfg_valid_entry()", convert the return value to bool, and update the return values and callers to match so testing "if (acpi_mcfg_valid_entry())" makes sense. Link: https://lore.kernel.org/r/[email protected] Tested-by: Tomasz Pala <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 7048910 commit 9ad6791

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arch/x86/pci/mmconfig-shared.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,22 @@ static void __init pci_mmcfg_reject_broken(int early)
576576
}
577577
}
578578

579-
static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
580-
struct acpi_mcfg_allocation *cfg)
579+
static bool __init acpi_mcfg_valid_entry(struct acpi_table_mcfg *mcfg,
580+
struct acpi_mcfg_allocation *cfg)
581581
{
582582
if (cfg->address < 0xFFFFFFFF)
583-
return 0;
583+
return true;
584584

585585
if (!strncmp(mcfg->header.oem_id, "SGI", 3))
586-
return 0;
586+
return true;
587587

588588
if ((mcfg->header.revision >= 1) && (dmi_get_bios_year() >= 2010))
589-
return 0;
589+
return true;
590590

591591
pr_err("ECAM at %#llx for %04x [bus %02x-%02x] is above 4GB, ignored\n",
592592
cfg->address, cfg->pci_segment, cfg->start_bus_number,
593593
cfg->end_bus_number);
594-
return -EINVAL;
594+
return false;
595595
}
596596

597597
static int __init pci_parse_mcfg(struct acpi_table_header *header)
@@ -622,7 +622,7 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
622622
cfg_table = (struct acpi_mcfg_allocation *) &mcfg[1];
623623
for (i = 0; i < entries; i++) {
624624
cfg = &cfg_table[i];
625-
if (acpi_mcfg_check_entry(mcfg, cfg)) {
625+
if (!acpi_mcfg_valid_entry(mcfg, cfg)) {
626626
free_all_mmcfg();
627627
return -ENODEV;
628628
}

0 commit comments

Comments
 (0)