ice: Cleanup ice_vsi_alloc_q_vectors

1. Remove local variable num_q_vectors and use vsi->num_q_vectors instead
2. Remove local variable pf and pass vsi->back to ice_pf_to_dev

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Anirudh Venkataramanan 2020-02-06 01:20:11 -08:00 committed by Jeff Kirsher
parent 19cce2c6f6
commit 3306f79f42
1 changed files with 3 additions and 8 deletions

View File

@ -503,20 +503,15 @@ int ice_vsi_ctrl_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx)
*/ */
int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi) int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi)
{ {
struct ice_pf *pf = vsi->back; struct device *dev = ice_pf_to_dev(vsi->back);
int v_idx = 0, num_q_vectors; int v_idx, err;
struct device *dev;
int err;
dev = ice_pf_to_dev(pf);
if (vsi->q_vectors[0]) { if (vsi->q_vectors[0]) {
dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num); dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num);
return -EEXIST; return -EEXIST;
} }
num_q_vectors = vsi->num_q_vectors; for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) {
for (v_idx = 0; v_idx < num_q_vectors; v_idx++) {
err = ice_vsi_alloc_q_vector(vsi, v_idx); err = ice_vsi_alloc_q_vector(vsi, v_idx);
if (err) if (err)
goto err_out; goto err_out;