Commit 3306f79f authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Jeff Kirsher

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: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 19cce2c6
...@@ -503,20 +503,15 @@ int ice_vsi_ctrl_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx) ...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment