pnv_ioda_get_pe() indicates it's increasing refcount to the given
PE instance from the name. However, it gets the instance of the
PE, which contains the indicated PCI device. The patch renames it
to pnv_ioda_dev_to_pe() to reflect its purpose.

Signed-off-by: Gavin Shan <gws...@linux.vnet.ibm.com>
---
v5:
  * Split from PATCH[v4 07/21]
  * Fixed "do not use assignment in if condition" from checkpatch.pl
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c 
b/arch/powerpc/platforms/powernv/pci-ioda.c
index 0447534..e9165fa 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -702,7 +702,7 @@ static int pnv_ioda_get_pe_state(struct pnv_phb *phb, int 
pe_no)
  * but in the meantime, we need to protect them to avoid warnings
  */
 #ifdef CONFIG_PCI_MSI
-static struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev)
+static struct pnv_ioda_pe *pnv_ioda_dev_to_pe(struct pci_dev *dev)
 {
        struct pci_controller *hose = pci_bus_to_host(dev->bus);
        struct pnv_phb *phb = hose->private_data;
@@ -2671,7 +2671,7 @@ int pnv_phb_to_cxl_mode(struct pci_dev *dev, uint64_t 
mode)
        struct pnv_ioda_pe *pe;
        int rc;
 
-       pe = pnv_ioda_get_pe(dev);
+       pe = pnv_ioda_dev_to_pe(dev);
        if (!pe)
                return -ENODEV;
 
@@ -2787,7 +2787,8 @@ int pnv_cxl_ioda_msi_setup(struct pci_dev *dev, unsigned 
int hwirq,
        struct pnv_ioda_pe *pe;
        int rc;
 
-       if (!(pe = pnv_ioda_get_pe(dev)))
+       pe = pnv_ioda_dev_to_pe(dev);
+       if (!pe)
                return -ENODEV;
 
        /* Assign XIVE to PE */
@@ -2809,7 +2810,7 @@ static int pnv_pci_ioda_msi_setup(struct pnv_phb *phb, 
struct pci_dev *dev,
                                  unsigned int hwirq, unsigned int virq,
                                  unsigned int is_64, struct msi_msg *msg)
 {
-       struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev);
+       struct pnv_ioda_pe *pe = pnv_ioda_dev_to_pe(dev);
        unsigned int xive_num = hwirq - phb->msi_base;
        __be32 data;
        int rc;
-- 
2.1.0

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to