i40e: fix some bit tests
Subsystems (3)
PATCH 1/1 i40e: fix some bit tests
These tests don't work as intended because __I40E_TESTING and I40E_VF_STAT_ACTIVE are bit numbers and not masks.
Fixes e17bc411aea8 ('i40e: Disable offline diagnostics if VFs are enabled')
Signed-off-by Dan Carpenter <[email protected]>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -1
@@ -980,7 +980,7 @@ static int i40e_pci_sriov_enable(struct pci_dev *pdev, int num_vfs)int pre_existing_vfs =pci_num_vf (pdev);int err =0 ; -if (pf->state & __I40E_TESTING) { +if (test_bit (__I40E_TESTING, &pf->state)) {dev_warn (&pdev->dev,"Cannot enable SR-IOV virtual functions while the device is undergoing diagnostic testing\n" ); err = -EPERM ;
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -1555,7 +1555,7 @@ static inline bool i40e_active_vfs(struct i40e_pf *pf)int i;for (i =0 ; i < pf->num_alloc_vfs; i++) -if (vfs[i].vf_states &I40E_VF_STAT_ACTIVE ) +if (test_bit (I40E_VF_STAT_ACTIVE , &vfs[i].vf_states))return true;return false; }