]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ice: Reduce scope of variable in ice_vsi_cfg_rxqs
authorBrett Creeley <brett.creeley@intel.com>
Thu, 28 Feb 2019 23:25:51 +0000 (15:25 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 2 May 2019 08:05:38 +0000 (01:05 -0700)
Reduce scope of the variable 'err' to inside the for loop instead
of using it as a second looping conditional. Also while here,
improve the debug message if we fail to configure a Rx queue.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
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_lib.c

index fa8ebd8a10ceff0f321ab9252417e14747b209f6..61bb9e92f6ce90b96b5f3db428ff8d6b6b00ccee 100644 (file)
@@ -1641,7 +1641,6 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)
  */
 int ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
 {
-       int err = 0;
        u16 i;
 
        if (vsi->type == ICE_VSI_VF)
@@ -1656,14 +1655,19 @@ int ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
        vsi->rx_buf_len = ICE_RXBUF_2048;
 setup_rings:
        /* set up individual rings */
-       for (i = 0; i < vsi->num_rxq && !err; i++)
-               err = ice_setup_rx_ctx(vsi->rx_rings[i]);
+       for (i = 0; i < vsi->num_rxq; i++) {
+               int err;
 
-       if (err) {
-               dev_err(&vsi->back->pdev->dev, "ice_setup_rx_ctx failed\n");
-               return -EIO;
+               err = ice_setup_rx_ctx(vsi->rx_rings[i]);
+               if (err) {
+                       dev_err(&vsi->back->pdev->dev,
+                               "ice_setup_rx_ctx failed for RxQ %d, err %d\n",
+                               i, err);
+                       return err;
+               }
        }
-       return err;
+
+       return 0;
 }
 
 /**