Skip to content

Commit a48fe63

Browse files
committed
x86/pci: Simplify is_mmconf_reserved() messages
is_mmconf_reserved() takes a "with_e820" parameter that only determines the message logged if it finds the MMCONFIG region is reserved. Pass the message directly, which will simplify a future patch that adds a new way of looking for that reservation. No functional change intended. Link: https://lore.kernel.org/r/[email protected] Tested-by: Tony Luck <[email protected]> Tested-by: Giovanni Cabiddu <[email protected]> Tested-by: Kan Liang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Dan Williams <[email protected]>
1 parent 760d560 commit a48fe63

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

arch/x86/pci/mmconfig-shared.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,12 @@ typedef bool (*check_reserved_t)(u64 start, u64 end, enum e820_type type);
446446

447447
static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
448448
struct pci_mmcfg_region *cfg,
449-
struct device *dev, int with_e820)
449+
struct device *dev, const char *method)
450450
{
451451
u64 addr = cfg->res.start;
452452
u64 size = resource_size(&cfg->res);
453453
u64 old_size = size;
454454
int num_buses;
455-
char *method = with_e820 ? "E820" : "ACPI motherboard resources";
456455

457456
while (!is_reserved(addr, addr + size, E820_TYPE_RESERVED)) {
458457
size >>= 1;
@@ -464,10 +463,10 @@ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
464463
return false;
465464

466465
if (dev)
467-
dev_info(dev, "MMCONFIG at %pR reserved in %s\n",
466+
dev_info(dev, "MMCONFIG at %pR reserved as %s\n",
468467
&cfg->res, method);
469468
else
470-
pr_info(PREFIX "MMCONFIG at %pR reserved in %s\n",
469+
pr_info(PREFIX "MMCONFIG at %pR reserved as %s\n",
471470
&cfg->res, method);
472471

473472
if (old_size != size) {
@@ -500,7 +499,8 @@ static bool __ref
500499
pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int early)
501500
{
502501
if (!early && !acpi_disabled) {
503-
if (is_mmconf_reserved(is_acpi_reserved, cfg, dev, 0))
502+
if (is_mmconf_reserved(is_acpi_reserved, cfg, dev,
503+
"ACPI motherboard resource"))
504504
return true;
505505

506506
if (dev)
@@ -527,7 +527,8 @@ pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int e
527527
/* Don't try to do this check unless configuration
528528
type 1 is available. how about type 2 ?*/
529529
if (raw_pci_ops)
530-
return is_mmconf_reserved(e820__mapped_all, cfg, dev, 1);
530+
return is_mmconf_reserved(e820__mapped_all, cfg, dev,
531+
"E820 entry");
531532

532533
return false;
533534
}

0 commit comments

Comments
 (0)