Re: [PATCH 5/7] powerpc/powernv/pci: Fix W=1 compile warning

2020-09-11 Thread Oliver O'Halloran
On Fri, Sep 11, 2020 at 7:02 AM Cédric Le Goater  wrote:
>
>   CC  arch/powerpc/platforms/powernv/pci-ioda.o
> ../arch/powerpc/platforms/powernv/pci-ioda.c: In function 
> ‘pnv_ioda_configure_pe’:
> ../arch/powerpc/platforms/powernv/pci-ioda.c:897:18: error: variable ‘parent’ 
> set but not used [-Werror=unused-but-set-variable]
>   struct pci_dev *parent;
>   ^~
>
> Cc: Oliver O'Halloran 
> Signed-off-by: Cédric Le Goater 

Come to think of it a fix for this might already be in -next, see
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=193967=*

If not,

Reviewed-by: Oliver O'Halloran 


Re: [PATCH 5/7] powerpc/powernv/pci: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy




Le 10/09/2020 à 23:02, Cédric Le Goater a écrit :

   CC  arch/powerpc/platforms/powernv/pci-ioda.o
../arch/powerpc/platforms/powernv/pci-ioda.c: In function 
‘pnv_ioda_configure_pe’:
../arch/powerpc/platforms/powernv/pci-ioda.c:897:18: error: variable ‘parent’ 
set but not used [-Werror=unused-but-set-variable]
   struct pci_dev *parent;
   ^~



A small sentence explaining how this is fixed would be welcome, so that 
you don't need to read the code the know what the commit does to fix the 
warning. Also the subject should be more explicit.




Cc: Oliver O'Halloran 
Signed-off-by: Cédric Le Goater 


Reviewed-by: Christophe Leroy 


---
  arch/powerpc/platforms/powernv/pci-ioda.c | 8 
  1 file changed, 8 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c 
b/arch/powerpc/platforms/powernv/pci-ioda.c
index 023a4f987bb2..2b4ceb5e6ce4 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -894,7 +894,6 @@ int pnv_ioda_deconfigure_pe(struct pnv_phb *phb, struct 
pnv_ioda_pe *pe)
  
  int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)

  {
-   struct pci_dev *parent;
uint8_t bcomp, dcomp, fcomp;
long rc, rid_end, rid;
  
@@ -904,7 +903,6 @@ int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
  
  		dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;

fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
-   parent = pe->pbus->self;
if (pe->flags & PNV_IODA_PE_BUS_ALL)
count = resource_size(>pbus->busn_res);
else
@@ -925,12 +923,6 @@ int pnv_ioda_configure_pe(struct pnv_phb *phb, struct 
pnv_ioda_pe *pe)
}
rid_end = pe->rid + (count << 8);
} else {
-#ifdef CONFIG_PCI_IOV
-   if (pe->flags & PNV_IODA_PE_VF)
-   parent = pe->parent_dev;
-   else
-#endif /* CONFIG_PCI_IOV */
-   parent = pe->pdev->bus->self;
bcomp = OpalPciBusAll;
dcomp = OPAL_COMPARE_RID_DEVICE_NUMBER;
fcomp = OPAL_COMPARE_RID_FUNCTION_NUMBER;