Commit d26e7fc3 authored by Bjorn Helgaas's avatar Bjorn Helgaas

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/20231121183643.249006-7-helgaas@kernel.orgTested-by: default avatarTomasz Pala <gotar@polanet.pl>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 9ad67912
...@@ -512,8 +512,8 @@ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved, ...@@ -512,8 +512,8 @@ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
return true; return true;
} }
static bool __ref static bool __ref pci_mmcfg_reserved(struct device *dev,
pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int early) struct pci_mmcfg_region *cfg, int early)
{ {
struct resource *conflict; struct resource *conflict;
...@@ -567,7 +567,7 @@ static void __init pci_mmcfg_reject_broken(int early) ...@@ -567,7 +567,7 @@ static void __init pci_mmcfg_reject_broken(int early)
struct pci_mmcfg_region *cfg; struct pci_mmcfg_region *cfg;
list_for_each_entry(cfg, &pci_mmcfg_list, list) { list_for_each_entry(cfg, &pci_mmcfg_list, list) {
if (pci_mmcfg_check_reserved(NULL, cfg, early) == 0) { if (!pci_mmcfg_reserved(NULL, cfg, early)) {
pr_info("not using ECAM (%pR not reserved)\n", pr_info("not using ECAM (%pR not reserved)\n",
&cfg->res); &cfg->res);
free_all_mmcfg(); free_all_mmcfg();
...@@ -796,7 +796,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, ...@@ -796,7 +796,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
if (cfg == NULL) { if (cfg == NULL) {
dev_warn(dev, "fail to add ECAM (out of memory)\n"); dev_warn(dev, "fail to add ECAM (out of memory)\n");
rc = -ENOMEM; rc = -ENOMEM;
} else if (!pci_mmcfg_check_reserved(dev, cfg, 0)) { } else if (!pci_mmcfg_reserved(dev, cfg, 0)) {
dev_warn(dev, FW_BUG "ECAM %pR isn't reserved\n", dev_warn(dev, FW_BUG "ECAM %pR isn't reserved\n",
&cfg->res); &cfg->res);
} else { } else {
......
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