On 9/27/2026 1:02 PM, Lukas Wunner wrote:
> Drop a superfluous call to pcie_aer_is_native() from handles_cxl_errors().
> 
> The call is superfluous because the function is only called from:
> 
>   aer_probe()
>     cxl_rch_enable_rcec()
>       handles_cxl_errors()
> 
> ...and aer_probe() is only invoked if an AER port service was instantiated
> in get_port_device_capability(), which is conditional on:
> 
>   (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT ||
>    pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC) &&
>   pci_aer_available() &&
>   dev->aer_cap && (pcie_ports_native || host->native_aer))
> 
> ...and the last line of those conditions is equivalent to
> pcie_aer_is_native().
> 
> Signed-off-by: Lukas Wunner <[email protected]>
> ---
>  drivers/pci/pcie/aer_cxl_rch.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aer_cxl_rch.c b/drivers/pci/pcie/aer_cxl_rch.c
> index e471eefec9c4..9cc2d5749b9d 100644
> --- a/drivers/pci/pcie/aer_cxl_rch.c
> +++ b/drivers/pci/pcie/aer_cxl_rch.c
> @@ -87,8 +87,7 @@ static bool handles_cxl_errors(struct pci_dev *rcec)
>  {
>       bool handles_cxl = false;
>  
> -     if (pci_pcie_type(rcec) == PCI_EXP_TYPE_RC_EC &&
> -         pcie_aer_is_native(rcec))
> +     if (pci_pcie_type(rcec) == PCI_EXP_TYPE_RC_EC)
>               pcie_walk_rcec(rcec, handles_cxl_error_iter, &handles_cxl);
>  
>       return handles_cxl;


Nice cleanup. The pcie_aer_is_native() check isn't necessary. You can add my RB.

Reviewed-by: Terry Bowman <[email protected]>

-Terry 


Reply via email to