Re: [PATCH 7/8] PCI: Convert PCIBIOS_ error codes to non-PCI generic error codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 09, 2020 at 05:39:49PM +0200, refactormyself@xxxxxxxxx wrote:
> From: Bolarinwa Olayemi Saheed <refactormyself@xxxxxxxxx>
> 
> pci_disable_pcie_error_reporting() returns PCIBIOS_ error code which were
> passed down the call heirarchy from pcie capability accessors.
> 
> PCIBIOS_ error codes have positive values. Passing on these values is
> inconsistent with functions which return only a negative value on failure.
> 
> Before passing on return value of pcie capability accessors, call
> pcibios_err_to_errno() to convert any positive PCIBIOS_ error codes to
> negative non-PCI generic error values.
> 
> Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@xxxxxxxxx>
> Suggested-by: Bjorn Helgaas <bjorn@xxxxxxxxxxx>
> ---
>  drivers/pci/pcie/aer.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 95d480a52078..53e2ecb64c72 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -365,11 +365,15 @@ EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting);
>  
>  int pci_disable_pcie_error_reporting(struct pci_dev *dev)
>  {
> +	int rc;
> +
>  	if (pcie_aer_get_firmware_first(dev))
>  		return -EIO;
>  
> -	return pcie_capability_clear_word(dev, PCI_EXP_DEVCTL,
> +	rc = pcie_capability_clear_word(dev, PCI_EXP_DEVCTL,
>  					  PCI_EXP_AER_FLAGS);
> +
> +	return rc;

Also missing pcibios_err_to_errno()?

>  }
>  EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
>  
> -- 
> 2.18.2
> 



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux