ice: reduce scope of variable
authorPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Wed, 31 Mar 2021 21:17:08 +0000 (14:17 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 15 Apr 2021 00:12:18 +0000 (17:12 -0700)
The scope of this variable can be reduced so do that.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c

index a3d8d06b1e3f7be26fa872ad37791446695e82c3..e38d4adc5b8da38ac6502a93bd24a7eb71b2dbb1 100644 (file)
@@ -4234,7 +4234,6 @@ void ice_print_vfs_mdd_events(struct ice_pf *pf)
  */
 void ice_restore_all_vfs_msi_state(struct pci_dev *pdev)
 {
-       struct pci_dev *vfdev;
        u16 vf_id;
        int pos;
 
@@ -4243,6 +4242,8 @@ void ice_restore_all_vfs_msi_state(struct pci_dev *pdev)
 
        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
        if (pos) {
+               struct pci_dev *vfdev;
+
                pci_read_config_word(pdev, pos + PCI_SRIOV_VF_DID,
                                     &vf_id);
                vfdev = pci_get_device(pdev->vendor, vf_id, NULL);