Commit bd557d97 authored by Tony Nguyen's avatar Tony Nguyen

ice: Reduce scope of variables

There are some places where the scope of a variable can
be reduced, so do that.
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
parent 2ffd87d3
...@@ -391,10 +391,11 @@ ice_upd_dvm_boost_entry(struct ice_hw *hw, struct ice_dvm_entry *entry) ...@@ -391,10 +391,11 @@ ice_upd_dvm_boost_entry(struct ice_hw *hw, struct ice_dvm_entry *entry)
*/ */
int ice_set_dvm_boost_entries(struct ice_hw *hw) int ice_set_dvm_boost_entries(struct ice_hw *hw)
{ {
int status;
u16 i; u16 i;
for (i = 0; i < hw->dvm_upd.count; i++) { for (i = 0; i < hw->dvm_upd.count; i++) {
int status;
status = ice_upd_dvm_boost_entry(hw, &hw->dvm_upd.tbl[i]); status = ice_upd_dvm_boost_entry(hw, &hw->dvm_upd.tbl[i]);
if (status) if (status)
return status; return status;
...@@ -3195,12 +3196,13 @@ ice_rem_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, ...@@ -3195,12 +3196,13 @@ ice_rem_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig,
u16 idx = vsig & ICE_VSIG_IDX_M; u16 idx = vsig & ICE_VSIG_IDX_M;
struct ice_vsig_vsi *vsi_cur; struct ice_vsig_vsi *vsi_cur;
struct ice_vsig_prof *d, *t; struct ice_vsig_prof *d, *t;
int status;
/* remove TCAM entries */ /* remove TCAM entries */
list_for_each_entry_safe(d, t, list_for_each_entry_safe(d, t,
&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst,
list) { list) {
int status;
status = ice_rem_prof_id(hw, blk, d); status = ice_rem_prof_id(hw, blk, d);
if (status) if (status)
return status; return status;
...@@ -3251,12 +3253,13 @@ ice_rem_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, ...@@ -3251,12 +3253,13 @@ ice_rem_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,
{ {
u16 idx = vsig & ICE_VSIG_IDX_M; u16 idx = vsig & ICE_VSIG_IDX_M;
struct ice_vsig_prof *p, *t; struct ice_vsig_prof *p, *t;
int status;
list_for_each_entry_safe(p, t, list_for_each_entry_safe(p, t,
&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst,
list) list)
if (p->profile_cookie == hdl) { if (p->profile_cookie == hdl) {
int status;
if (ice_vsig_prof_id_count(hw, blk, vsig) == 1) if (ice_vsig_prof_id_count(hw, blk, vsig) == 1)
/* this is the last profile, remove the VSIG */ /* this is the last profile, remove the VSIG */
return ice_rem_vsig(hw, blk, vsig, chg); return ice_rem_vsig(hw, blk, vsig, chg);
......
...@@ -1654,12 +1654,13 @@ ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle, ...@@ -1654,12 +1654,13 @@ ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,
u32 first_node_teid; u32 first_node_teid;
u16 num_added = 0; u16 num_added = 0;
u8 i, qgl, vsil; u8 i, qgl, vsil;
int status;
qgl = ice_sched_get_qgrp_layer(hw); qgl = ice_sched_get_qgrp_layer(hw);
vsil = ice_sched_get_vsi_layer(hw); vsil = ice_sched_get_vsi_layer(hw);
parent = ice_sched_get_vsi_node(pi, tc_node, vsi_handle); parent = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
for (i = vsil + 1; i <= qgl; i++) { for (i = vsil + 1; i <= qgl; i++) {
int status;
if (!parent) if (!parent)
return -EIO; return -EIO;
...@@ -1755,13 +1756,14 @@ ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_handle, ...@@ -1755,13 +1756,14 @@ ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_handle,
u32 first_node_teid; u32 first_node_teid;
u16 num_added = 0; u16 num_added = 0;
u8 i, vsil; u8 i, vsil;
int status;
if (!pi) if (!pi)
return -EINVAL; return -EINVAL;
vsil = ice_sched_get_vsi_layer(pi->hw); vsil = ice_sched_get_vsi_layer(pi->hw);
for (i = pi->hw->sw_entry_point_layer; i <= vsil; i++) { for (i = pi->hw->sw_entry_point_layer; i <= vsil; i++) {
int status;
status = ice_sched_add_nodes_to_layer(pi, tc_node, parent, status = ice_sched_add_nodes_to_layer(pi, tc_node, parent,
i, num_nodes[i], i, num_nodes[i],
&first_node_teid, &first_node_teid,
......
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