Re: [PATCH v13 22/25] CXL/PCI: Export and rename merge_result() to pci_ers_merge_result()

From: Bjorn Helgaas
Date: Mon Dec 08 2025 - 13:38:39 EST


Possible subject:

PCI/ERR: Rename merge_result() to pcie_ers_merge_result()

since there's no CXL content here.

On Mon, Nov 03, 2025 at 06:09:58PM -0600, Terry Bowman wrote:
> CXL uncorrectable errors (UCE) will soon be handled separately from the PCI
> AER handling. The merge_result() function can be made common to use in both
> handling paths.
>
> Rename the PCI subsystem's merge_result() to be pci_ers_merge_result().
> Export pci_ers_merge_result() to make available for the CXL and other
> drivers to use.

Still dubious about exporting this.

> Update pci_ers_merge_result() to support recently introduced PCI_ERS_RESULT_PANIC
> result.

Code is pcie_ers_merge_result(), not pci_ers_merge_result().

But I actually think "pci" might be more appropriate because I think
this is used in generic PCI paths that can be exercised for non-PCIe.
Either way, make them all consistent.

> +++ b/drivers/pci/pcie/err.c
> @@ -21,9 +21,12 @@
> #include "portdrv.h"
> #include "../pci.h"
>
> -static pci_ers_result_t merge_result(enum pci_ers_result orig,
> - enum pci_ers_result new)
> +pci_ers_result_t pcie_ers_merge_result(enum pci_ers_result orig,
> + enum pci_ers_result new)
> {
> + if (new == PCI_ERS_RESULT_PANIC)
> + return PCI_ERS_RESULT_PANIC;

I think this should be squashed with the "CXL/PCI: Introduce
PCI_ERS_RESULT_PANIC" patch and called:

PCI/ERR: Add PCI_ERS_RESULT_PANIC

so the new functionality is all together and the rename is separate.