Skip to content

Commit d26e7fc

Browse files
committed
x86/pci: Rename pci_mmcfg_check_reserved() to pci_mmcfg_reserved()
"pci_mmcfg_check_reserved()" doesn't give a hint about what the boolean return value means. Rename it to pci_mmcfg_reserved() so testing "if (pci_mmcfg_reserved())" makes sense. Update callers to treat the return value as boolean instead of comparing with 0. Link: https://lore.kernel.org/r/[email protected] Tested-by: Tomasz Pala <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 9ad6791 commit d26e7fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/pci/mmconfig-shared.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
512512
return true;
513513
}
514514

515-
static bool __ref
516-
pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int early)
515+
static bool __ref pci_mmcfg_reserved(struct device *dev,
516+
struct pci_mmcfg_region *cfg, int early)
517517
{
518518
struct resource *conflict;
519519

@@ -567,7 +567,7 @@ static void __init pci_mmcfg_reject_broken(int early)
567567
struct pci_mmcfg_region *cfg;
568568

569569
list_for_each_entry(cfg, &pci_mmcfg_list, list) {
570-
if (pci_mmcfg_check_reserved(NULL, cfg, early) == 0) {
570+
if (!pci_mmcfg_reserved(NULL, cfg, early)) {
571571
pr_info("not using ECAM (%pR not reserved)\n",
572572
&cfg->res);
573573
free_all_mmcfg();
@@ -796,7 +796,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
796796
if (cfg == NULL) {
797797
dev_warn(dev, "fail to add ECAM (out of memory)\n");
798798
rc = -ENOMEM;
799-
} else if (!pci_mmcfg_check_reserved(dev, cfg, 0)) {
799+
} else if (!pci_mmcfg_reserved(dev, cfg, 0)) {
800800
dev_warn(dev, FW_BUG "ECAM %pR isn't reserved\n",
801801
&cfg->res);
802802
} else {

0 commit comments

Comments
 (0)