[PATCH v1 07/19] ACPI: extlog: Provide HEST generic data to extlog_print_pcie()

From: Pierre Gondois

Date: Tue Nov 17 2026 - 06:18:01 EST


Pass struct acpi_hest_generic_data to extlog_print_pcie() and derive
the payload, severity and length from it instead of passing them
individually. This reduces the number of arguments and makes the
section flags available for subsequent changes.

Signed-off-by: Pierre Gondois <pierre.gondois@xxxxxxx>
---
drivers/acpi/acpi_extlog.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index 5565177be328f..125f7931b98bc 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -133,10 +133,10 @@ static int print_extlog_rcd(const char *pfx,
return 1;
}

-static void extlog_print_pcie(struct cper_sec_pcie *pcie_err,
- int severity, u32 len)
+static void extlog_print_pcie(struct acpi_hest_generic_data *gdata)
{
#ifdef CONFIG_ACPI_APEI_PCIEAER
+ struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata);
struct aer_capability_regs aer_regs = {};
struct pci_dev *pdev;
unsigned int devfn;
@@ -144,9 +144,10 @@ static void extlog_print_pcie(struct cper_sec_pcie *pcie_err,
int aer_severity;
int domain;

- if (len < sizeof(*pcie_err)) {
+ if (gdata->error_data_length < sizeof(*pcie_err)) {
pr_warn_ratelimited(FW_WARN
- "PCIe error section too small (%u)\n", len);
+ "PCIe error section too small (%u)\n",
+ gdata->error_data_length);
return;
}

@@ -154,7 +155,7 @@ static void extlog_print_pcie(struct cper_sec_pcie *pcie_err,
pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO))
return;

- aer_severity = cper_severity_to_aer(severity);
+ aer_severity = cper_severity_to_aer(gdata->error_severity);

aer_cap_regs_unpack(&aer_regs, pcie_err->aer_info, sizeof(pcie_err->aer_info));

@@ -245,10 +246,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
gdata->error_severity,
gdata->error_data_length);
} else if (guid_equal(sec_type, &CPER_SEC_PCIE)) {
- struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata);
-
- extlog_print_pcie(pcie_err, gdata->error_severity,
- gdata->error_data_length);
+ extlog_print_pcie(gdata);
} else {
void *err = acpi_hest_get_payload(gdata);

--
2.43.0