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
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)
>
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
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 =
4 matches
Mail list logo