ice: Cleanup ice_vsi_alloc_q_vectors
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Thu, 6 Feb 2020 09:20:11 +0000 (01:20 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 12 Feb 2020 19:49:04 +0000 (11:49 -0800)
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>
drivers/net/ethernet/intel/ice/ice_base.c

index 46f427a95056b881fc39c8c8aa3a247ab4e9ed6f..81885efadc7a6472b82da6c42f1602de76526acb 100644 (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)
 {
-       struct ice_pf *pf = vsi->back;
-       int v_idx = 0, num_q_vectors;
-       struct device *dev;
-       int err;
+       struct device *dev = ice_pf_to_dev(vsi->back);
+       int v_idx, err;
 
-       dev = ice_pf_to_dev(pf);
        if (vsi->q_vectors[0]) {
                dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num);
                return -EEXIST;
        }
 
-       num_q_vectors = vsi->num_q_vectors;
-
-       for (v_idx = 0; v_idx < num_q_vectors; v_idx++) {
+       for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) {
                err = ice_vsi_alloc_q_vector(vsi, v_idx);
                if (err)
                        goto err_out;