Re: [RESEND PATCH 1/2] fpga: dfl: pci: reduce the scope of variable 'ret'

2020-07-11 Thread Tom Rix
Ok, i take your point on the api. However I still feel that this change should be improved so the return is not defined inside a block. I think this could be done better with int ret = num_vfs; ... return ret; There is no consistency on this check with the other drivers' sriov_configure. I

Re: [RESEND PATCH 1/2] fpga: dfl: pci: reduce the scope of variable 'ret'

2020-07-09 Thread Xu Yilun
On Thu, Jul 09, 2020 at 06:18:18AM -0700, Tom Rix wrote: > I think a better change is to use the ret variable, like this > > --- a/drivers/fpga/dfl-pci.c > +++ b/drivers/fpga/dfl-pci.c > @@ -312,7 +312,7 @@ static int cci_pci_sriov_configure(struct pci_dev > *pcidev, int num_vfs) >   

Re: [RESEND PATCH 1/2] fpga: dfl: pci: reduce the scope of variable 'ret'

2020-07-09 Thread Tom Rix
I think a better change is to use the ret variable, like this --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -312,7 +312,7 @@ static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs)     }     }   -   return num_vfs; +   return ret;  } The exi

[RESEND PATCH 1/2] fpga: dfl: pci: reduce the scope of variable 'ret'

2020-07-09 Thread Xu Yilun
This is to fix lkp cppcheck warnings: drivers/fpga/dfl-pci.c:230:6: warning: The scope of the variable 'ret' can be reduced. [variableScope] int ret = 0; ^ drivers/fpga/dfl-pci.c:230:10: warning: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret =