提交 1553f4f7 编写于 作者: B Brett Creeley 提交者: Jeff Kirsher

ice: Reduce scope of variable in ice_vsi_cfg_rxqs

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: NBrett Creeley <brett.creeley@intel.com>
Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 fe7219fa
...@@ -1641,7 +1641,6 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid) ...@@ -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 ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
{ {
int err = 0;
u16 i; u16 i;
if (vsi->type == ICE_VSI_VF) if (vsi->type == ICE_VSI_VF)
...@@ -1656,14 +1655,19 @@ int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) ...@@ -1656,14 +1655,19 @@ int ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
vsi->rx_buf_len = ICE_RXBUF_2048; vsi->rx_buf_len = ICE_RXBUF_2048;
setup_rings: setup_rings:
/* set up individual rings */ /* set up individual rings */
for (i = 0; i < vsi->num_rxq && !err; i++) for (i = 0; i < vsi->num_rxq; i++) {
err = ice_setup_rx_ctx(vsi->rx_rings[i]); int err;
if (err) { err = ice_setup_rx_ctx(vsi->rx_rings[i]);
dev_err(&vsi->back->pdev->dev, "ice_setup_rx_ctx failed\n"); if (err) {
return -EIO; 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;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册