vfio/pci: Change the variable 'physfn' definition scope
Subsystems (2)
PATCH 1/1 vfio/pci: Change the variable 'physfn' definition scope
Move the variable 'physfn' definition into PF finding code block, since it is initialized and used there.
Signed-off-by Haiyue Wang <[email protected]>
--- drivers/vfio/pci/vfio_pci_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/vfio/pci/vfio_pci_core.c +1 -2
@@ -2006,7 +2006,6 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev) {struct pci_dev *pdev = vdev->pdev;struct vfio_pci_core_device *cur; -struct pci_dev *physfn;int ret;if (pdev->is_virtfn) {
@@ -2016,7 +2015,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev)* the locking in pci_disable_sriov() it cannot change until * this VF device driver is removed. */ - physfn =pci_physfn (vdev->pdev); +struct pci_dev *physfn =pci_physfn (vdev->pdev);mutex_lock (&vfio_pci_sriov_pfs_mutex);list_for_each_entry (cur, &vfio_pci_sriov_pfs, sriov_pfs_item) {if (cur->pdev == physfn) {
Signature · 1 line
2.48.0